ipip: fix sparse warnings in ipip_netlink_parms()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 15 Nov 2012 04:06:40 +0000 (04:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Nov 2012 18:46:29 +0000 (13:46 -0500)
This change fixes two sparse warnings triggered by casting the ip addresses
from netlink messages in an u32 instead of be32. This change corrects that
in order to resolve the sparse warnings.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipip.c

index 64686e1f54d9175925ceb546124e0c9a269490c1..c26c1717c1dbdb04f011dc40e451296080dc46f9 100644 (file)
@@ -864,10 +864,10 @@ static void ipip_netlink_parms(struct nlattr *data[],
                parms->link = nla_get_u32(data[IFLA_IPTUN_LINK]);
 
        if (data[IFLA_IPTUN_LOCAL])
-               parms->iph.saddr = nla_get_u32(data[IFLA_IPTUN_LOCAL]);
+               parms->iph.saddr = nla_get_be32(data[IFLA_IPTUN_LOCAL]);
 
        if (data[IFLA_IPTUN_REMOTE])
-               parms->iph.daddr = nla_get_u32(data[IFLA_IPTUN_REMOTE]);
+               parms->iph.daddr = nla_get_be32(data[IFLA_IPTUN_REMOTE]);
 
        if (data[IFLA_IPTUN_TTL]) {
                parms->iph.ttl = nla_get_u8(data[IFLA_IPTUN_TTL]);