Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a409caec authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 67765146
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1506,12 +1506,12 @@ static bool ipip6_netlink_encap_parms(struct nlattr *data[],


	if (data[IFLA_IPTUN_ENCAP_SPORT]) {
	if (data[IFLA_IPTUN_ENCAP_SPORT]) {
		ret = true;
		ret = true;
		ipencap->sport = nla_get_u16(data[IFLA_IPTUN_ENCAP_SPORT]);
		ipencap->sport = nla_get_be16(data[IFLA_IPTUN_ENCAP_SPORT]);
	}
	}


	if (data[IFLA_IPTUN_ENCAP_DPORT]) {
	if (data[IFLA_IPTUN_ENCAP_DPORT]) {
		ret = true;
		ret = true;
		ipencap->dport = nla_get_u16(data[IFLA_IPTUN_ENCAP_DPORT]);
		ipencap->dport = nla_get_be16(data[IFLA_IPTUN_ENCAP_DPORT]);
	}
	}


	return ret;
	return ret;
@@ -1707,9 +1707,9 @@ static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)


	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE,
	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE,
			tunnel->encap.type) ||
			tunnel->encap.type) ||
	    nla_put_u16(skb, IFLA_IPTUN_ENCAP_SPORT,
	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT,
			tunnel->encap.sport) ||
			tunnel->encap.sport) ||
	    nla_put_u16(skb, IFLA_IPTUN_ENCAP_DPORT,
	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT,
			tunnel->encap.dport) ||
			tunnel->encap.dport) ||
	    nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS,
	    nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS,
			tunnel->encap.flags))
			tunnel->encap.flags))