mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
UPSTREAM: tipc: check the bearer min mtu properly when setting it by netlink
[ Upstream commit35a089b5d7] Checking the bearer min mtu with tipc_udp_mtu_bad() only works for IPv4 UDP bearer, and IPv6 UDP bearer has a different value for the min mtu. This patch checks with encap_hlen + TIPC_MIN_BEARER_MTU for min mtu, which works for both IPv4 and IPv6 UDP bearer. Note that tipc_udp_mtu_bad() is still used to check media min mtu in __tipc_nl_media_set(), as m->mtu currently is only used by the IPv4 UDP bearer as its default mtu value. Fixes:682cd3cf94("tipc: confgiure and apply UDP bearer MTU on running links") Change-Id: I585703598475f2de30353fcc7a96e295fe63549b Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit673cb47989) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5b20b206c4
commit
61d1582c93
@@ -1151,8 +1151,8 @@ int __tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info)
|
||||
return -EINVAL;
|
||||
}
|
||||
#ifdef CONFIG_TIPC_MEDIA_UDP
|
||||
if (tipc_udp_mtu_bad(nla_get_u32
|
||||
(props[TIPC_NLA_PROP_MTU]))) {
|
||||
if (nla_get_u32(props[TIPC_NLA_PROP_MTU]) <
|
||||
b->encap_hlen + TIPC_MIN_BEARER_MTU) {
|
||||
NL_SET_ERR_MSG(info->extack,
|
||||
"MTU value is out-of-range");
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user