Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ipv6: fix return value of ip6_skb_dst_mtu

Commit 628a5c561890 ("[INET]: Add IP(V6)_PMTUDISC_RPOBE") introduced
ip6_skb_dst_mtu with return value of signed int which is inconsistent
with actually returned values. Also 2 users of this function actually
assign its value to unsigned int variable and only __xfrm6_output
assigns result of this function to signed variable but actually uses
as unsigned in further comparisons and calls. Change this function
to return unsigned int value.

Fixes: 628a5c561890 ("[INET]: Add IP(V6)_PMTUDISC_RPOBE")
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vadim Fedorenko and committed by
David S. Miller
40fc3054 bde3c8ff

+2 -2
+1 -1
include/net/ip6_route.h
··· 263 263 int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, 264 264 int (*output)(struct net *, struct sock *, struct sk_buff *)); 265 265 266 - static inline int ip6_skb_dst_mtu(struct sk_buff *skb) 266 + static inline unsigned int ip6_skb_dst_mtu(struct sk_buff *skb) 267 267 { 268 268 int mtu; 269 269
+1 -1
net/ipv6/xfrm6_output.c
··· 49 49 { 50 50 struct dst_entry *dst = skb_dst(skb); 51 51 struct xfrm_state *x = dst->xfrm; 52 - int mtu; 52 + unsigned int mtu; 53 53 bool toobig; 54 54 55 55 #ifdef CONFIG_NETFILTER