diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-03 01:12:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 04:10:05 -0400 |
commit | f9d751667fd60788fe3641738938e0968e99cece (patch) | |
tree | 96898832e8190044741b083a0b55fee0ed895db3 /net/bridge | |
parent | c473737765c0f72ceb5b245ada7ead798d88b4f6 (diff) |
br_netfilter: Convert to dst_neigh_lookup_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 4378775432b6..b98d3d78ca7f 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -375,19 +375,29 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) | |||
375 | if (!skb->dev) | 375 | if (!skb->dev) |
376 | goto free_skb; | 376 | goto free_skb; |
377 | dst = skb_dst(skb); | 377 | dst = skb_dst(skb); |
378 | neigh = dst_get_neighbour_noref(dst); | 378 | neigh = dst_neigh_lookup_skb(dst, skb); |
379 | if (neigh->hh.hh_len) { | 379 | if (neigh) { |
380 | neigh_hh_bridge(&neigh->hh, skb); | 380 | int ret; |
381 | skb->dev = nf_bridge->physindev; | 381 | |
382 | return br_handle_frame_finish(skb); | 382 | if (neigh->hh.hh_len) { |
383 | } else { | 383 | neigh_hh_bridge(&neigh->hh, skb); |
384 | /* the neighbour function below overwrites the complete | 384 | skb->dev = nf_bridge->physindev; |
385 | * MAC header, so we save the Ethernet source address and | 385 | ret = br_handle_frame_finish(skb); |
386 | * protocol number. */ | 386 | } else { |
387 | skb_copy_from_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN), skb->nf_bridge->data, ETH_HLEN-ETH_ALEN); | 387 | /* the neighbour function below overwrites the complete |
388 | /* tell br_dev_xmit to continue with forwarding */ | 388 | * MAC header, so we save the Ethernet source address and |
389 | nf_bridge->mask |= BRNF_BRIDGED_DNAT; | 389 | * protocol number. |
390 | return neigh->output(neigh, skb); | 390 | */ |
391 | skb_copy_from_linear_data_offset(skb, | ||
392 | -(ETH_HLEN-ETH_ALEN), | ||
393 | skb->nf_bridge->data, | ||
394 | ETH_HLEN-ETH_ALEN); | ||
395 | /* tell br_dev_xmit to continue with forwarding */ | ||
396 | nf_bridge->mask |= BRNF_BRIDGED_DNAT; | ||
397 | ret = neigh->output(neigh, skb); | ||
398 | } | ||
399 | neigh_release(neigh); | ||
400 | return ret; | ||
391 | } | 401 | } |
392 | free_skb: | 402 | free_skb: |
393 | kfree_skb(skb); | 403 | kfree_skb(skb); |