diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2015-02-06 11:22:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-08 19:28:06 -0500 |
commit | 3e97fa7059c19f7cc2566dfb30fe9282f6f1e673 (patch) | |
tree | 679a7f5aa080e81e30ad07ee7bf7eeafc2adf72f /net | |
parent | 51a00daf7369b581e5241c5cae5924886deda261 (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')
-rw-r--r-- | net/ipv4/ip_gre.c | 12 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 6e7727f27393..6207275fc749 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -659,12 +659,12 @@ static bool ipgre_netlink_encap_parms(struct nlattr *data[], | |||
659 | 659 | ||
660 | if (data[IFLA_GRE_ENCAP_SPORT]) { | 660 | if (data[IFLA_GRE_ENCAP_SPORT]) { |
661 | ret = true; | 661 | ret = true; |
662 | ipencap->sport = nla_get_u16(data[IFLA_GRE_ENCAP_SPORT]); | 662 | ipencap->sport = nla_get_be16(data[IFLA_GRE_ENCAP_SPORT]); |
663 | } | 663 | } |
664 | 664 | ||
665 | if (data[IFLA_GRE_ENCAP_DPORT]) { | 665 | if (data[IFLA_GRE_ENCAP_DPORT]) { |
666 | ret = true; | 666 | ret = true; |
667 | ipencap->dport = nla_get_u16(data[IFLA_GRE_ENCAP_DPORT]); | 667 | ipencap->dport = nla_get_be16(data[IFLA_GRE_ENCAP_DPORT]); |
668 | } | 668 | } |
669 | 669 | ||
670 | return ret; | 670 | return ret; |
@@ -786,10 +786,10 @@ static int ipgre_fill_info(struct sk_buff *skb, const struct net_device *dev) | |||
786 | 786 | ||
787 | if (nla_put_u16(skb, IFLA_GRE_ENCAP_TYPE, | 787 | if (nla_put_u16(skb, IFLA_GRE_ENCAP_TYPE, |
788 | t->encap.type) || | 788 | t->encap.type) || |
789 | nla_put_u16(skb, IFLA_GRE_ENCAP_SPORT, | 789 | nla_put_be16(skb, IFLA_GRE_ENCAP_SPORT, |
790 | t->encap.sport) || | 790 | t->encap.sport) || |
791 | nla_put_u16(skb, IFLA_GRE_ENCAP_DPORT, | 791 | nla_put_be16(skb, IFLA_GRE_ENCAP_DPORT, |
792 | t->encap.dport) || | 792 | t->encap.dport) || |
793 | nla_put_u16(skb, IFLA_GRE_ENCAP_FLAGS, | 793 | nla_put_u16(skb, IFLA_GRE_ENCAP_FLAGS, |
794 | t->encap.flags)) | 794 | t->encap.flags)) |
795 | goto nla_put_failure; | 795 | goto nla_put_failure; |
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; |