aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-04 11:30:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-04 11:30:12 -0500
commit75fa67706cce5272bcfc51ed646f2da21f3bdb6e (patch)
treec60c18f4fd4c0853feee6bb84b9fdadcb33e59e5 /net
parent4edfd20fafae41d77f210417b43d1416a733f48c (diff)
parentbbb770e7ab9a436752babfc8765e422d7481be1f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: xfrm: Fix xfrm_policy_gc_lock handling. niu: Use pci_ioremap_bar(). bnx2x: Version Update bnx2x: Calling netif_carrier_off at the end of the probe bnx2x: PCI configuration bug on big-endian bnx2x: Removing the PMF indication when unloading mv643xx_eth: fix SMI bus access timeouts net: kconfig cleanup fs_enet: fix polling XFRM: copy_to_user_kmaddress() reports local address twice SMC91x: Fix compilation on some platforms. udp: Fix the SNMP counter of UDP_MIB_INERRORS udp: Fix the SNMP counter of UDP_MIB_INDATAGRAMS drivers/net/smc911x.c: Fix lockdep warning on xmit.
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/udp.c28
-rw-r--r--net/xfrm/xfrm_policy.c4
-rw-r--r--net/xfrm/xfrm_user.c2
3 files changed, 24 insertions, 10 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 71e259e866a1..8b48512ebf6a 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -138,6 +138,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
138 int peeked; 138 int peeked;
139 int err; 139 int err;
140 int is_udplite = IS_UDPLITE(sk); 140 int is_udplite = IS_UDPLITE(sk);
141 int is_udp4;
141 142
142 if (addr_len) 143 if (addr_len)
143 *addr_len=sizeof(struct sockaddr_in6); 144 *addr_len=sizeof(struct sockaddr_in6);
@@ -158,6 +159,8 @@ try_again:
158 else if (copied < ulen) 159 else if (copied < ulen)
159 msg->msg_flags |= MSG_TRUNC; 160 msg->msg_flags |= MSG_TRUNC;
160 161
162 is_udp4 = (skb->protocol == htons(ETH_P_IP));
163
161 /* 164 /*
162 * If checksum is needed at all, try to do it while copying the 165 * If checksum is needed at all, try to do it while copying the
163 * data. If the data is truncated, or if we only want a partial 166 * data. If the data is truncated, or if we only want a partial
@@ -180,9 +183,14 @@ try_again:
180 if (err) 183 if (err)
181 goto out_free; 184 goto out_free;
182 185
183 if (!peeked) 186 if (!peeked) {
184 UDP6_INC_STATS_USER(sock_net(sk), 187 if (is_udp4)
185 UDP_MIB_INDATAGRAMS, is_udplite); 188 UDP_INC_STATS_USER(sock_net(sk),
189 UDP_MIB_INDATAGRAMS, is_udplite);
190 else
191 UDP6_INC_STATS_USER(sock_net(sk),
192 UDP_MIB_INDATAGRAMS, is_udplite);
193 }
186 194
187 sock_recv_timestamp(msg, sk, skb); 195 sock_recv_timestamp(msg, sk, skb);
188 196
@@ -196,7 +204,7 @@ try_again:
196 sin6->sin6_flowinfo = 0; 204 sin6->sin6_flowinfo = 0;
197 sin6->sin6_scope_id = 0; 205 sin6->sin6_scope_id = 0;
198 206
199 if (skb->protocol == htons(ETH_P_IP)) 207 if (is_udp4)
200 ipv6_addr_set(&sin6->sin6_addr, 0, 0, 208 ipv6_addr_set(&sin6->sin6_addr, 0, 0,
201 htonl(0xffff), ip_hdr(skb)->saddr); 209 htonl(0xffff), ip_hdr(skb)->saddr);
202 else { 210 else {
@@ -207,7 +215,7 @@ try_again:
207 } 215 }
208 216
209 } 217 }
210 if (skb->protocol == htons(ETH_P_IP)) { 218 if (is_udp4) {
211 if (inet->cmsg_flags) 219 if (inet->cmsg_flags)
212 ip_cmsg_recv(msg, skb); 220 ip_cmsg_recv(msg, skb);
213 } else { 221 } else {
@@ -228,8 +236,14 @@ out:
228 236
229csum_copy_err: 237csum_copy_err:
230 lock_sock(sk); 238 lock_sock(sk);
231 if (!skb_kill_datagram(sk, skb, flags)) 239 if (!skb_kill_datagram(sk, skb, flags)) {
232 UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_INERRORS, is_udplite); 240 if (is_udp4)
241 UDP_INC_STATS_USER(sock_net(sk),
242 UDP_MIB_INERRORS, is_udplite);
243 else
244 UDP6_INC_STATS_USER(sock_net(sk),
245 UDP_MIB_INERRORS, is_udplite);
246 }
233 release_sock(sk); 247 release_sock(sk);
234 248
235 if (flags & MSG_DONTWAIT) 249 if (flags & MSG_DONTWAIT)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 25872747762c..058f04f54b90 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -315,9 +315,9 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
315 return; 315 return;
316 } 316 }
317 317
318 spin_lock(&xfrm_policy_gc_lock); 318 spin_lock_bh(&xfrm_policy_gc_lock);
319 hlist_add_head(&policy->bydst, &xfrm_policy_gc_list); 319 hlist_add_head(&policy->bydst, &xfrm_policy_gc_list);
320 spin_unlock(&xfrm_policy_gc_lock); 320 spin_unlock_bh(&xfrm_policy_gc_lock);
321 321
322 schedule_work(&xfrm_policy_gc_work); 322 schedule_work(&xfrm_policy_gc_work);
323} 323}
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 4a8a1abb59ee..a278a6f3b991 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1816,7 +1816,7 @@ static int copy_to_user_kmaddress(struct xfrm_kmaddress *k, struct sk_buff *skb)
1816 uk.family = k->family; 1816 uk.family = k->family;
1817 uk.reserved = k->reserved; 1817 uk.reserved = k->reserved;
1818 memcpy(&uk.local, &k->local, sizeof(uk.local)); 1818 memcpy(&uk.local, &k->local, sizeof(uk.local));
1819 memcpy(&uk.remote, &k->local, sizeof(uk.remote)); 1819 memcpy(&uk.remote, &k->remote, sizeof(uk.remote));
1820 1820
1821 return nla_put(skb, XFRMA_KMADDRESS, sizeof(uk), &uk); 1821 return nla_put(skb, XFRMA_KMADDRESS, sizeof(uk), &uk);
1822} 1822}