Commit f9d75166 authored by David S. Miller's avatar David S. Miller

br_netfilter: Convert to dst_neigh_lookup_skb().

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c4737377
...@@ -375,19 +375,29 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) ...@@ -375,19 +375,29 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
if (!skb->dev) if (!skb->dev)
goto free_skb; goto free_skb;
dst = skb_dst(skb); dst = skb_dst(skb);
neigh = dst_get_neighbour_noref(dst); neigh = dst_neigh_lookup_skb(dst, skb);
if (neigh) {
int ret;
if (neigh->hh.hh_len) { if (neigh->hh.hh_len) {
neigh_hh_bridge(&neigh->hh, skb); neigh_hh_bridge(&neigh->hh, skb);
skb->dev = nf_bridge->physindev; skb->dev = nf_bridge->physindev;
return br_handle_frame_finish(skb); ret = br_handle_frame_finish(skb);
} else { } else {
/* the neighbour function below overwrites the complete /* the neighbour function below overwrites the complete
* MAC header, so we save the Ethernet source address and * MAC header, so we save the Ethernet source address and
* protocol number. */ * protocol number.
skb_copy_from_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN), skb->nf_bridge->data, ETH_HLEN-ETH_ALEN); */
skb_copy_from_linear_data_offset(skb,
-(ETH_HLEN-ETH_ALEN),
skb->nf_bridge->data,
ETH_HLEN-ETH_ALEN);
/* tell br_dev_xmit to continue with forwarding */ /* tell br_dev_xmit to continue with forwarding */
nf_bridge->mask |= BRNF_BRIDGED_DNAT; nf_bridge->mask |= BRNF_BRIDGED_DNAT;
return neigh->output(neigh, skb); ret = neigh->output(neigh, skb);
}
neigh_release(neigh);
return ret;
} }
free_skb: free_skb:
kfree_skb(skb); kfree_skb(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment