diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-28 04:19:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-28 04:19:40 -0400 |
commit | 1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9 (patch) | |
tree | fe3dc41cbb47ae12b7c3faf6a88b097349e50d5a /net/core | |
parent | e35c3269edba151e1c703d87068a28ce2cd65bb0 (diff) | |
parent | d420895efb259a78dda50f95289571faa6e10e41 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl4965-base.c
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 6 | ||||
-rw-r--r-- | net/core/net_namespace.c | 3 | ||||
-rw-r--r-- | net/core/skbuff.c | 17 |
3 files changed, 20 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index f6944ecd5b2e..472676dd550e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2107,6 +2107,10 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2107 | 2107 | ||
2108 | rcu_read_lock(); | 2108 | rcu_read_lock(); |
2109 | 2109 | ||
2110 | /* Don't receive packets in an exiting network namespace */ | ||
2111 | if (!net_alive(dev_net(skb->dev))) | ||
2112 | goto out; | ||
2113 | |||
2110 | #ifdef CONFIG_NET_CLS_ACT | 2114 | #ifdef CONFIG_NET_CLS_ACT |
2111 | if (skb->tc_verd & TC_NCLS) { | 2115 | if (skb->tc_verd & TC_NCLS) { |
2112 | skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); | 2116 | skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); |
@@ -3034,7 +3038,7 @@ EXPORT_SYMBOL(dev_unicast_delete); | |||
3034 | /** | 3038 | /** |
3035 | * dev_unicast_add - add a secondary unicast address | 3039 | * dev_unicast_add - add a secondary unicast address |
3036 | * @dev: device | 3040 | * @dev: device |
3037 | * @addr: address to delete | 3041 | * @addr: address to add |
3038 | * @alen: length of @addr | 3042 | * @alen: length of @addr |
3039 | * | 3043 | * |
3040 | * Add a secondary unicast address to the device or increase | 3044 | * Add a secondary unicast address to the device or increase |
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 72b4c184dd84..7c52fe277b62 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -140,6 +140,9 @@ static void cleanup_net(struct work_struct *work) | |||
140 | struct pernet_operations *ops; | 140 | struct pernet_operations *ops; |
141 | struct net *net; | 141 | struct net *net; |
142 | 142 | ||
143 | /* Be very certain incoming network packets will not find us */ | ||
144 | rcu_barrier(); | ||
145 | |||
143 | net = container_of(work, struct net, work); | 146 | net = container_of(work, struct net, work); |
144 | 147 | ||
145 | mutex_lock(&net_mutex); | 148 | mutex_lock(&net_mutex); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 2df012be973d..7c571560e9d2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1290,12 +1290,14 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1290 | { | 1290 | { |
1291 | unsigned int nr_pages = spd->nr_pages; | 1291 | unsigned int nr_pages = spd->nr_pages; |
1292 | unsigned int poff, plen, len, toff, tlen; | 1292 | unsigned int poff, plen, len, toff, tlen; |
1293 | int headlen, seg; | 1293 | int headlen, seg, error = 0; |
1294 | 1294 | ||
1295 | toff = *offset; | 1295 | toff = *offset; |
1296 | tlen = *total_len; | 1296 | tlen = *total_len; |
1297 | if (!tlen) | 1297 | if (!tlen) { |
1298 | error = 1; | ||
1298 | goto err; | 1299 | goto err; |
1300 | } | ||
1299 | 1301 | ||
1300 | /* | 1302 | /* |
1301 | * if the offset is greater than the linear part, go directly to | 1303 | * if the offset is greater than the linear part, go directly to |
@@ -1337,7 +1339,8 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1337 | * just jump directly to update and return, no point | 1339 | * just jump directly to update and return, no point |
1338 | * in going over fragments when the output is full. | 1340 | * in going over fragments when the output is full. |
1339 | */ | 1341 | */ |
1340 | if (spd_fill_page(spd, virt_to_page(p), plen, poff, skb)) | 1342 | error = spd_fill_page(spd, virt_to_page(p), plen, poff, skb); |
1343 | if (error) | ||
1341 | goto done; | 1344 | goto done; |
1342 | 1345 | ||
1343 | tlen -= plen; | 1346 | tlen -= plen; |
@@ -1367,7 +1370,8 @@ map_frag: | |||
1367 | if (!plen) | 1370 | if (!plen) |
1368 | break; | 1371 | break; |
1369 | 1372 | ||
1370 | if (spd_fill_page(spd, f->page, plen, poff, skb)) | 1373 | error = spd_fill_page(spd, f->page, plen, poff, skb); |
1374 | if (error) | ||
1371 | break; | 1375 | break; |
1372 | 1376 | ||
1373 | tlen -= plen; | 1377 | tlen -= plen; |
@@ -1380,7 +1384,10 @@ done: | |||
1380 | return 0; | 1384 | return 0; |
1381 | } | 1385 | } |
1382 | err: | 1386 | err: |
1383 | return 1; | 1387 | /* update the offset to reflect the linear part skip, if any */ |
1388 | if (!error) | ||
1389 | *offset = toff; | ||
1390 | return error; | ||
1384 | } | 1391 | } |
1385 | 1392 | ||
1386 | /* | 1393 | /* |