diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:04 -0400 |
commit | adf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch) | |
tree | 0f07542bb95de2ad537540868aba6cf87a86e17d /net/atm | |
parent | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff) |
net: skb->dst accessors
Define three accessors to get/set dst attached to a skb
struct dst_entry *skb_dst(const struct sk_buff *skb)
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
void skb_dst_drop(struct sk_buff *skb)
This one should replace occurrences of :
dst_release(skb->dst)
skb->dst = NULL;
Delete skb->dst field
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/br2684.c | 2 | ||||
-rw-r--r-- | net/atm/clip.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index bfa8fa9894fc..2912665fc58c 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -228,7 +228,7 @@ static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
228 | struct br2684_dev *brdev = BRPRIV(dev); | 228 | struct br2684_dev *brdev = BRPRIV(dev); |
229 | struct br2684_vcc *brvcc; | 229 | struct br2684_vcc *brvcc; |
230 | 230 | ||
231 | pr_debug("br2684_start_xmit, skb->dst=%p\n", skb->dst); | 231 | pr_debug("br2684_start_xmit, skb_dst(skb)=%p\n", skb_dst(skb)); |
232 | read_lock(&devs_lock); | 232 | read_lock(&devs_lock); |
233 | brvcc = pick_outgoing_vcc(skb, brdev); | 233 | brvcc = pick_outgoing_vcc(skb, brdev); |
234 | if (brvcc == NULL) { | 234 | if (brvcc == NULL) { |
diff --git a/net/atm/clip.c b/net/atm/clip.c index fb7623c080f8..e65a3b1477f8 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -369,16 +369,16 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
369 | unsigned long flags; | 369 | unsigned long flags; |
370 | 370 | ||
371 | pr_debug("clip_start_xmit (skb %p)\n", skb); | 371 | pr_debug("clip_start_xmit (skb %p)\n", skb); |
372 | if (!skb->dst) { | 372 | if (!skb_dst(skb)) { |
373 | printk(KERN_ERR "clip_start_xmit: skb->dst == NULL\n"); | 373 | printk(KERN_ERR "clip_start_xmit: skb_dst(skb) == NULL\n"); |
374 | dev_kfree_skb(skb); | 374 | dev_kfree_skb(skb); |
375 | dev->stats.tx_dropped++; | 375 | dev->stats.tx_dropped++; |
376 | return 0; | 376 | return 0; |
377 | } | 377 | } |
378 | if (!skb->dst->neighbour) { | 378 | if (!skb_dst(skb)->neighbour) { |
379 | #if 0 | 379 | #if 0 |
380 | skb->dst->neighbour = clip_find_neighbour(skb->dst, 1); | 380 | skb_dst(skb)->neighbour = clip_find_neighbour(skb_dst(skb), 1); |
381 | if (!skb->dst->neighbour) { | 381 | if (!skb_dst(skb)->neighbour) { |
382 | dev_kfree_skb(skb); /* lost that one */ | 382 | dev_kfree_skb(skb); /* lost that one */ |
383 | dev->stats.tx_dropped++; | 383 | dev->stats.tx_dropped++; |
384 | return 0; | 384 | return 0; |
@@ -389,7 +389,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
389 | dev->stats.tx_dropped++; | 389 | dev->stats.tx_dropped++; |
390 | return 0; | 390 | return 0; |
391 | } | 391 | } |
392 | entry = NEIGH2ENTRY(skb->dst->neighbour); | 392 | entry = NEIGH2ENTRY(skb_dst(skb)->neighbour); |
393 | if (!entry->vccs) { | 393 | if (!entry->vccs) { |
394 | if (time_after(jiffies, entry->expires)) { | 394 | if (time_after(jiffies, entry->expires)) { |
395 | /* should be resolved */ | 395 | /* should be resolved */ |
@@ -406,7 +406,7 @@ static int clip_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
406 | } | 406 | } |
407 | pr_debug("neigh %p, vccs %p\n", entry, entry->vccs); | 407 | pr_debug("neigh %p, vccs %p\n", entry, entry->vccs); |
408 | ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; | 408 | ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc; |
409 | pr_debug("using neighbour %p, vcc %p\n", skb->dst->neighbour, vcc); | 409 | pr_debug("using neighbour %p, vcc %p\n", skb_dst(skb)->neighbour, vcc); |
410 | if (entry->vccs->encap) { | 410 | if (entry->vccs->encap) { |
411 | void *here; | 411 | void *here; |
412 | 412 | ||