aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2015-02-06 11:22:22 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-08 19:28:06 -0500
commit3e97fa7059c19f7cc2566dfb30fe9282f6f1e673 (patch)
tree679a7f5aa080e81e30ad07ee7bf7eeafc2adf72f /net/ipv4/ipip.c
parent51a00daf7369b581e5241c5cae5924886deda261 (diff)
gre/ipip: use be16 variants of netlink functions
encap.sport and encap.dport are __be16, use nla_{get,put}_be16 instead of nla_{get,put}_u16. Fixes the sparse warnings: warning: incorrect type in assignment (different base types) expected restricted __be32 [addressable] [usertype] o_key got restricted __be16 [addressable] [usertype] i_flags warning: incorrect type in assignment (different base types) expected restricted __be16 [usertype] sport got unsigned short warning: incorrect type in assignment (different base types) expected restricted __be16 [usertype] dport got unsigned short warning: incorrect type in argument 3 (different base types) expected unsigned short [unsigned] [usertype] value got restricted __be16 [usertype] sport warning: incorrect type in argument 3 (different base types) expected unsigned short [unsigned] [usertype] value got restricted __be16 [usertype] dport Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index b58d6689874c..915d215a7d14 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -366,12 +366,12 @@ static bool ipip_netlink_encap_parms(struct nlattr *data[],
366 366
367 if (data[IFLA_IPTUN_ENCAP_SPORT]) { 367 if (data[IFLA_IPTUN_ENCAP_SPORT]) {
368 ret = true; 368 ret = true;
369 ipencap->sport = nla_get_u16(data[IFLA_IPTUN_ENCAP_SPORT]); 369 ipencap->sport = nla_get_be16(data[IFLA_IPTUN_ENCAP_SPORT]);
370 } 370 }
371 371
372 if (data[IFLA_IPTUN_ENCAP_DPORT]) { 372 if (data[IFLA_IPTUN_ENCAP_DPORT]) {
373 ret = true; 373 ret = true;
374 ipencap->dport = nla_get_u16(data[IFLA_IPTUN_ENCAP_DPORT]); 374 ipencap->dport = nla_get_be16(data[IFLA_IPTUN_ENCAP_DPORT]);
375 } 375 }
376 376
377 return ret; 377 return ret;
@@ -460,10 +460,10 @@ static int ipip_fill_info(struct sk_buff *skb, const struct net_device *dev)
460 460
461 if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, 461 if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE,
462 tunnel->encap.type) || 462 tunnel->encap.type) ||
463 nla_put_u16(skb, IFLA_IPTUN_ENCAP_SPORT, 463 nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT,
464 tunnel->encap.sport) || 464 tunnel->encap.sport) ||
465 nla_put_u16(skb, IFLA_IPTUN_ENCAP_DPORT, 465 nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT,
466 tunnel->encap.dport) || 466 tunnel->encap.dport) ||
467 nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS, 467 nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS,
468 tunnel->encap.flags)) 468 tunnel->encap.flags))
469 goto nla_put_failure; 469 goto nla_put_failure;