diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-14 10:53:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-14 10:53:20 -0400 |
commit | f6b72b6217f8c24f2a54988e58af858b4e66024d (patch) | |
tree | c59d5adcf9bb226db6f602c5078106052524cfea /net/bridge | |
parent | 390fd0b388e4f85549e5d60bdeb21364b344d9b9 (diff) |
net: Embed hh_cache inside of struct neighbour.
Now that there is a one-to-one correspondance between neighbour
and hh_cache entries, we no longer need:
1) dynamic allocation
2) attachment to dst->hh
3) refcounting
Initialization of the hh_cache entry is indicated by hh_len
being non-zero, and such initialization is always done with
the neighbour's lock held as a writer.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 56149ec36d7f..75ee421917c7 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -343,14 +343,16 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb) | |||
343 | static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) | 343 | static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) |
344 | { | 344 | { |
345 | struct nf_bridge_info *nf_bridge = skb->nf_bridge; | 345 | struct nf_bridge_info *nf_bridge = skb->nf_bridge; |
346 | struct neighbour *neigh; | ||
346 | struct dst_entry *dst; | 347 | struct dst_entry *dst; |
347 | 348 | ||
348 | skb->dev = bridge_parent(skb->dev); | 349 | skb->dev = bridge_parent(skb->dev); |
349 | if (!skb->dev) | 350 | if (!skb->dev) |
350 | goto free_skb; | 351 | goto free_skb; |
351 | dst = skb_dst(skb); | 352 | dst = skb_dst(skb); |
352 | if (dst->hh) { | 353 | neigh = dst->neighbour; |
353 | neigh_hh_bridge(dst->hh, skb); | 354 | if (neigh->hh.hh_len) { |
355 | neigh_hh_bridge(&neigh->hh, skb); | ||
354 | skb->dev = nf_bridge->physindev; | 356 | skb->dev = nf_bridge->physindev; |
355 | return br_handle_frame_finish(skb); | 357 | return br_handle_frame_finish(skb); |
356 | } else if (dst->neighbour) { | 358 | } else if (dst->neighbour) { |