aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-18 02:09:49 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-18 02:11:35 -0400
commit69cce1d1404968f78b177a0314f5822d5afdbbfb (patch)
tree26223264fd69ea8078d0013fd5a76eb7aeb04c12 /net/atm
parent9cbb7ecbcff85077bb12301aaf4c9b5a56c5993d (diff)
net: Abstract dst->neighbour accesses behind helpers.
dst_{get,set}_neighbour() Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/clip.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/atm/clip.c b/net/atm/clip.c
index c6cd5318be3..4bc8c67ecb1 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -362,33 +362,37 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
362 struct net_device *dev) 362 struct net_device *dev)
363{ 363{
364 struct clip_priv *clip_priv = PRIV(dev); 364 struct clip_priv *clip_priv = PRIV(dev);
365 struct dst_entry *dst = skb_dst(skb);
365 struct atmarp_entry *entry; 366 struct atmarp_entry *entry;
367 struct neighbour *n;
366 struct atm_vcc *vcc; 368 struct atm_vcc *vcc;
367 int old; 369 int old;
368 unsigned long flags; 370 unsigned long flags;
369 371
370 pr_debug("(skb %p)\n", skb); 372 pr_debug("(skb %p)\n", skb);
371 if (!skb_dst(skb)) { 373 if (!dst) {
372 pr_err("skb_dst(skb) == NULL\n"); 374 pr_err("skb_dst(skb) == NULL\n");
373 dev_kfree_skb(skb); 375 dev_kfree_skb(skb);
374 dev->stats.tx_dropped++; 376 dev->stats.tx_dropped++;
375 return NETDEV_TX_OK; 377 return NETDEV_TX_OK;
376 } 378 }
377 if (!skb_dst(skb)->neighbour) { 379 n = dst_get_neighbour(dst);
380 if (!n) {
378#if 0 381#if 0
379 skb_dst(skb)->neighbour = clip_find_neighbour(skb_dst(skb), 1); 382 n = clip_find_neighbour(skb_dst(skb), 1);
380 if (!skb_dst(skb)->neighbour) { 383 if (!n) {
381 dev_kfree_skb(skb); /* lost that one */ 384 dev_kfree_skb(skb); /* lost that one */
382 dev->stats.tx_dropped++; 385 dev->stats.tx_dropped++;
383 return 0; 386 return 0;
384 } 387 }
388 dst_set_neighbour(dst, n);
385#endif 389#endif
386 pr_err("NO NEIGHBOUR !\n"); 390 pr_err("NO NEIGHBOUR !\n");
387 dev_kfree_skb(skb); 391 dev_kfree_skb(skb);
388 dev->stats.tx_dropped++; 392 dev->stats.tx_dropped++;
389 return NETDEV_TX_OK; 393 return NETDEV_TX_OK;
390 } 394 }
391 entry = NEIGH2ENTRY(skb_dst(skb)->neighbour); 395 entry = NEIGH2ENTRY(n);
392 if (!entry->vccs) { 396 if (!entry->vccs) {
393 if (time_after(jiffies, entry->expires)) { 397 if (time_after(jiffies, entry->expires)) {
394 /* should be resolved */ 398 /* should be resolved */
@@ -405,7 +409,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
405 } 409 }
406 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs); 410 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs);
407 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; 411 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc;
408 pr_debug("using neighbour %p, vcc %p\n", skb_dst(skb)->neighbour, vcc); 412 pr_debug("using neighbour %p, vcc %p\n", n, vcc);
409 if (entry->vccs->encap) { 413 if (entry->vccs->encap) {
410 void *here; 414 void *here;
411 415