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

sit: fix some __be16/u16 mismatches

Fixes following sparse warnings :

net/ipv6/sit.c:1509:32: warning: incorrect type in assignment (different base types)
net/ipv6/sit.c:1509:32: expected restricted __be16 [usertype] sport
net/ipv6/sit.c:1509:32: got unsigned short
net/ipv6/sit.c:1514:32: warning: incorrect type in assignment (different base types)
net/ipv6/sit.c:1514:32: expected restricted __be16 [usertype] dport
net/ipv6/sit.c:1514:32: got unsigned short
net/ipv6/sit.c:1711:38: warning: incorrect type in argument 3 (different base types)
net/ipv6/sit.c:1711:38: expected unsigned short [unsigned] [usertype] value
net/ipv6/sit.c:1711:38: got restricted __be16 [usertype] sport
net/ipv6/sit.c:1713:38: warning: incorrect type in argument 3 (different base types)
net/ipv6/sit.c:1713:38: expected unsigned short [unsigned] [usertype] value
net/ipv6/sit.c:1713:38: got restricted __be16 [usertype] dport

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
a409caec 67765146

+4 -4
+4 -4
net/ipv6/sit.c
··· 1506 1506 1507 1507 if (data[IFLA_IPTUN_ENCAP_SPORT]) { 1508 1508 ret = true; 1509 - ipencap->sport = nla_get_u16(data[IFLA_IPTUN_ENCAP_SPORT]); 1509 + ipencap->sport = nla_get_be16(data[IFLA_IPTUN_ENCAP_SPORT]); 1510 1510 } 1511 1511 1512 1512 if (data[IFLA_IPTUN_ENCAP_DPORT]) { 1513 1513 ret = true; 1514 - ipencap->dport = nla_get_u16(data[IFLA_IPTUN_ENCAP_DPORT]); 1514 + ipencap->dport = nla_get_be16(data[IFLA_IPTUN_ENCAP_DPORT]); 1515 1515 } 1516 1516 1517 1517 return ret; ··· 1707 1707 1708 1708 if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, 1709 1709 tunnel->encap.type) || 1710 - nla_put_u16(skb, IFLA_IPTUN_ENCAP_SPORT, 1710 + nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, 1711 1711 tunnel->encap.sport) || 1712 - nla_put_u16(skb, IFLA_IPTUN_ENCAP_DPORT, 1712 + nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, 1713 1713 tunnel->encap.dport) || 1714 1714 nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS, 1715 1715 tunnel->encap.flags))