diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-01-16 14:27:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-17 10:31:12 -0500 |
commit | 747465ef7a082033e086dedc8189febfda43b015 (patch) | |
tree | efbdc7a1f25f7bced035077769b4005ea1419abc /net/ipv4 | |
parent | 2b2d465631db59c144f537a9bef47a883c55d670 (diff) |
net: fix some sparse errors
make C=2 CF="-D__CHECK_ENDIAN__" M=net
And fix flowi4_init_output() prototype for sport
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inetpeer.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 8 | ||||
-rw-r--r-- | net/ipv4/ping.c | 27 |
3 files changed, 19 insertions, 18 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index 86f13c67ea85..986a02bda660 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -136,7 +136,7 @@ static int addr_compare(const struct inetpeer_addr *a, | |||
136 | for (i = 0; i < n; i++) { | 136 | for (i = 0; i < n; i++) { |
137 | if (a->addr.a6[i] == b->addr.a6[i]) | 137 | if (a->addr.a6[i] == b->addr.a6[i]) |
138 | continue; | 138 | continue; |
139 | if (a->addr.a6[i] < b->addr.a6[i]) | 139 | if ((__force u32)a->addr.a6[i] < (__force u32)b->addr.a6[i]) |
140 | return -1; | 140 | return -1; |
141 | return 1; | 141 | return 1; |
142 | } | 142 | } |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 7e4ec9fc2cef..6e412a60a91f 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -141,7 +141,7 @@ __be32 ic_servaddr = NONE; /* Boot server IP address */ | |||
141 | __be32 root_server_addr = NONE; /* Address of NFS server */ | 141 | __be32 root_server_addr = NONE; /* Address of NFS server */ |
142 | u8 root_server_path[256] = { 0, }; /* Path to mount as root */ | 142 | u8 root_server_path[256] = { 0, }; /* Path to mount as root */ |
143 | 143 | ||
144 | u32 ic_dev_xid; /* Device under configuration */ | 144 | __be32 ic_dev_xid; /* Device under configuration */ |
145 | 145 | ||
146 | /* vendor class identifier */ | 146 | /* vendor class identifier */ |
147 | static char vendor_class_identifier[253] __initdata; | 147 | static char vendor_class_identifier[253] __initdata; |
@@ -859,9 +859,9 @@ static int __init ic_bootp_string(char *dest, char *src, int len, int max) | |||
859 | */ | 859 | */ |
860 | static void __init ic_do_bootp_ext(u8 *ext) | 860 | static void __init ic_do_bootp_ext(u8 *ext) |
861 | { | 861 | { |
862 | u8 servers; | 862 | u8 servers; |
863 | int i; | 863 | int i; |
864 | u16 mtu; | 864 | __be16 mtu; |
865 | 865 | ||
866 | #ifdef IPCONFIG_DEBUG | 866 | #ifdef IPCONFIG_DEBUG |
867 | u8 *c; | 867 | u8 *c; |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 43d4c3b22369..aea5a199c37a 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -140,13 +140,14 @@ static void ping_v4_unhash(struct sock *sk) | |||
140 | write_lock_bh(&ping_table.lock); | 140 | write_lock_bh(&ping_table.lock); |
141 | hlist_nulls_del(&sk->sk_nulls_node); | 141 | hlist_nulls_del(&sk->sk_nulls_node); |
142 | sock_put(sk); | 142 | sock_put(sk); |
143 | isk->inet_num = isk->inet_sport = 0; | 143 | isk->inet_num = 0; |
144 | isk->inet_sport = 0; | ||
144 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); | 145 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); |
145 | write_unlock_bh(&ping_table.lock); | 146 | write_unlock_bh(&ping_table.lock); |
146 | } | 147 | } |
147 | } | 148 | } |
148 | 149 | ||
149 | static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr, | 150 | static struct sock *ping_v4_lookup(struct net *net, __be32 saddr, __be32 daddr, |
150 | u16 ident, int dif) | 151 | u16 ident, int dif) |
151 | { | 152 | { |
152 | struct hlist_nulls_head *hslot = ping_hashslot(&ping_table, net, ident); | 153 | struct hlist_nulls_head *hslot = ping_hashslot(&ping_table, net, ident); |
@@ -154,15 +155,15 @@ static struct sock *ping_v4_lookup(struct net *net, u32 saddr, u32 daddr, | |||
154 | struct inet_sock *isk; | 155 | struct inet_sock *isk; |
155 | struct hlist_nulls_node *hnode; | 156 | struct hlist_nulls_node *hnode; |
156 | 157 | ||
157 | pr_debug("try to find: num = %d, daddr = %ld, dif = %d\n", | 158 | pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n", |
158 | (int)ident, (unsigned long)daddr, dif); | 159 | (int)ident, &daddr, dif); |
159 | read_lock_bh(&ping_table.lock); | 160 | read_lock_bh(&ping_table.lock); |
160 | 161 | ||
161 | ping_portaddr_for_each_entry(sk, hnode, hslot) { | 162 | ping_portaddr_for_each_entry(sk, hnode, hslot) { |
162 | isk = inet_sk(sk); | 163 | isk = inet_sk(sk); |
163 | 164 | ||
164 | pr_debug("found: %p: num = %d, daddr = %ld, dif = %d\n", sk, | 165 | pr_debug("found: %p: num = %d, daddr = %pI4, dif = %d\n", sk, |
165 | (int)isk->inet_num, (unsigned long)isk->inet_rcv_saddr, | 166 | (int)isk->inet_num, &isk->inet_rcv_saddr, |
166 | sk->sk_bound_dev_if); | 167 | sk->sk_bound_dev_if); |
167 | 168 | ||
168 | pr_debug("iterate\n"); | 169 | pr_debug("iterate\n"); |
@@ -254,7 +255,7 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
254 | sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); | 255 | sk, addr->sin_addr.s_addr, ntohs(addr->sin_port)); |
255 | 256 | ||
256 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); | 257 | chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr); |
257 | if (addr->sin_addr.s_addr == INADDR_ANY) | 258 | if (addr->sin_addr.s_addr == htonl(INADDR_ANY)) |
258 | chk_addr_ret = RTN_LOCAL; | 259 | chk_addr_ret = RTN_LOCAL; |
259 | 260 | ||
260 | if ((sysctl_ip_nonlocal_bind == 0 && | 261 | if ((sysctl_ip_nonlocal_bind == 0 && |
@@ -278,9 +279,9 @@ static int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
278 | goto out; | 279 | goto out; |
279 | } | 280 | } |
280 | 281 | ||
281 | pr_debug("after bind(): num = %d, daddr = %ld, dif = %d\n", | 282 | pr_debug("after bind(): num = %d, daddr = %pI4, dif = %d\n", |
282 | (int)isk->inet_num, | 283 | (int)isk->inet_num, |
283 | (unsigned long) isk->inet_rcv_saddr, | 284 | &isk->inet_rcv_saddr, |
284 | (int)sk->sk_bound_dev_if); | 285 | (int)sk->sk_bound_dev_if); |
285 | 286 | ||
286 | err = 0; | 287 | err = 0; |
@@ -407,7 +408,7 @@ out: | |||
407 | struct pingfakehdr { | 408 | struct pingfakehdr { |
408 | struct icmphdr icmph; | 409 | struct icmphdr icmph; |
409 | struct iovec *iov; | 410 | struct iovec *iov; |
410 | u32 wcheck; | 411 | __wsum wcheck; |
411 | }; | 412 | }; |
412 | 413 | ||
413 | static int ping_getfrag(void *from, char * to, | 414 | static int ping_getfrag(void *from, char * to, |
@@ -459,7 +460,7 @@ static int ping_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
459 | struct rtable *rt = NULL; | 460 | struct rtable *rt = NULL; |
460 | struct ip_options_data opt_copy; | 461 | struct ip_options_data opt_copy; |
461 | int free = 0; | 462 | int free = 0; |
462 | u32 saddr, daddr, faddr; | 463 | __be32 saddr, daddr, faddr; |
463 | u8 tos; | 464 | u8 tos; |
464 | int err; | 465 | int err; |
465 | 466 | ||
@@ -696,8 +697,8 @@ void ping_rcv(struct sk_buff *skb) | |||
696 | struct net *net = dev_net(skb->dev); | 697 | struct net *net = dev_net(skb->dev); |
697 | struct iphdr *iph = ip_hdr(skb); | 698 | struct iphdr *iph = ip_hdr(skb); |
698 | struct icmphdr *icmph = icmp_hdr(skb); | 699 | struct icmphdr *icmph = icmp_hdr(skb); |
699 | u32 saddr = iph->saddr; | 700 | __be32 saddr = iph->saddr; |
700 | u32 daddr = iph->daddr; | 701 | __be32 daddr = iph->daddr; |
701 | 702 | ||
702 | /* We assume the packet has already been checked by icmp_rcv */ | 703 | /* We assume the packet has already been checked by icmp_rcv */ |
703 | 704 | ||