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/core/neighbour.c | |
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/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index a1cbce7fdae5..c54229befcfe 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1088,8 +1088,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
1088 | struct neighbour *n1 = neigh; | 1088 | struct neighbour *n1 = neigh; |
1089 | write_unlock_bh(&neigh->lock); | 1089 | write_unlock_bh(&neigh->lock); |
1090 | /* On shaper/eql skb->dst->neighbour != neigh :( */ | 1090 | /* On shaper/eql skb->dst->neighbour != neigh :( */ |
1091 | if (skb->dst && skb->dst->neighbour) | 1091 | if (skb_dst(skb) && skb_dst(skb)->neighbour) |
1092 | n1 = skb->dst->neighbour; | 1092 | n1 = skb_dst(skb)->neighbour; |
1093 | n1->output(skb); | 1093 | n1->output(skb); |
1094 | write_lock_bh(&neigh->lock); | 1094 | write_lock_bh(&neigh->lock); |
1095 | } | 1095 | } |
@@ -1182,7 +1182,7 @@ EXPORT_SYMBOL(neigh_compat_output); | |||
1182 | 1182 | ||
1183 | int neigh_resolve_output(struct sk_buff *skb) | 1183 | int neigh_resolve_output(struct sk_buff *skb) |
1184 | { | 1184 | { |
1185 | struct dst_entry *dst = skb->dst; | 1185 | struct dst_entry *dst = skb_dst(skb); |
1186 | struct neighbour *neigh; | 1186 | struct neighbour *neigh; |
1187 | int rc = 0; | 1187 | int rc = 0; |
1188 | 1188 | ||
@@ -1229,7 +1229,7 @@ EXPORT_SYMBOL(neigh_resolve_output); | |||
1229 | int neigh_connected_output(struct sk_buff *skb) | 1229 | int neigh_connected_output(struct sk_buff *skb) |
1230 | { | 1230 | { |
1231 | int err; | 1231 | int err; |
1232 | struct dst_entry *dst = skb->dst; | 1232 | struct dst_entry *dst = skb_dst(skb); |
1233 | struct neighbour *neigh = dst->neighbour; | 1233 | struct neighbour *neigh = dst->neighbour; |
1234 | struct net_device *dev = neigh->dev; | 1234 | struct net_device *dev = neigh->dev; |
1235 | 1235 | ||
@@ -1298,8 +1298,7 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, | |||
1298 | if (time_before(tbl->proxy_timer.expires, sched_next)) | 1298 | if (time_before(tbl->proxy_timer.expires, sched_next)) |
1299 | sched_next = tbl->proxy_timer.expires; | 1299 | sched_next = tbl->proxy_timer.expires; |
1300 | } | 1300 | } |
1301 | dst_release(skb->dst); | 1301 | skb_dst_drop(skb); |
1302 | skb->dst = NULL; | ||
1303 | dev_hold(skb->dev); | 1302 | dev_hold(skb->dev); |
1304 | __skb_queue_tail(&tbl->proxy_queue, skb); | 1303 | __skb_queue_tail(&tbl->proxy_queue, skb); |
1305 | mod_timer(&tbl->proxy_timer, sched_next); | 1304 | mod_timer(&tbl->proxy_timer, sched_next); |