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>
This commit is contained in:
parent
390fd0b388
commit
f6b72b6217
9 changed files with 59 additions and 105 deletions
|
@ -343,14 +343,16 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
|
|||
static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
|
||||
{
|
||||
struct nf_bridge_info *nf_bridge = skb->nf_bridge;
|
||||
struct neighbour *neigh;
|
||||
struct dst_entry *dst;
|
||||
|
||||
skb->dev = bridge_parent(skb->dev);
|
||||
if (!skb->dev)
|
||||
goto free_skb;
|
||||
dst = skb_dst(skb);
|
||||
if (dst->hh) {
|
||||
neigh_hh_bridge(dst->hh, skb);
|
||||
neigh = dst->neighbour;
|
||||
if (neigh->hh.hh_len) {
|
||||
neigh_hh_bridge(&neigh->hh, skb);
|
||||
skb->dev = nf_bridge->physindev;
|
||||
return br_handle_frame_finish(skb);
|
||||
} else if (dst->neighbour) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue