Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

neigh: Remove by-hand SKB queue handling.

Signed-off-by: David S. Miller <davem@davemloft.net>

+8 -13
+8 -13
net/core/neighbour.c
··· 927 927 if (skb_queue_len(&neigh->arp_queue) >= 928 928 neigh->parms->queue_len) { 929 929 struct sk_buff *buff; 930 - buff = neigh->arp_queue.next; 931 - __skb_unlink(buff, &neigh->arp_queue); 930 + buff = __skb_dequeue(&neigh->arp_queue); 932 931 kfree_skb(buff); 933 932 NEIGH_CACHE_STAT_INC(neigh->tbl, unres_discards); 934 933 } ··· 1258 1259 struct neigh_table *tbl = (struct neigh_table *)arg; 1259 1260 long sched_next = 0; 1260 1261 unsigned long now = jiffies; 1261 - struct sk_buff *skb; 1262 + struct sk_buff *skb, *n; 1262 1263 1263 1264 spin_lock(&tbl->proxy_queue.lock); 1264 1265 1265 - skb = tbl->proxy_queue.next; 1266 + skb_queue_walk_safe(&tbl->proxy_queue, skb, n) { 1267 + long tdif = NEIGH_CB(skb)->sched_next - now; 1266 1268 1267 - while (skb != (struct sk_buff *)&tbl->proxy_queue) { 1268 - struct sk_buff *back = skb; 1269 - long tdif = NEIGH_CB(back)->sched_next - now; 1270 - 1271 - skb = skb->next; 1272 1269 if (tdif <= 0) { 1273 - struct net_device *dev = back->dev; 1274 - __skb_unlink(back, &tbl->proxy_queue); 1270 + struct net_device *dev = skb->dev; 1271 + __skb_unlink(skb, &tbl->proxy_queue); 1275 1272 if (tbl->proxy_redo && netif_running(dev)) 1276 - tbl->proxy_redo(back); 1273 + tbl->proxy_redo(skb); 1277 1274 else 1278 - kfree_skb(back); 1275 + kfree_skb(skb); 1279 1276 1280 1277 dev_put(dev); 1281 1278 } else if (!sched_next || tdif < sched_next)