Commit 7fb48c5b authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

netfilter: bridge: neigh_head and physoutdev can't be used at same time

The neigh_header is only needed when we detect DNAT after prerouting
and neigh cache didn't have a mac address for us.

The output port has not been chosen yet so we can re-use the storage
area, bringing struct size down to 32 bytes on x86_64.
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent a9756e6f
...@@ -170,12 +170,14 @@ struct nf_bridge_info { ...@@ -170,12 +170,14 @@ struct nf_bridge_info {
BRNF_PROTO_UNCHANGED, BRNF_PROTO_UNCHANGED,
BRNF_PROTO_8021Q, BRNF_PROTO_8021Q,
BRNF_PROTO_PPPOE BRNF_PROTO_PPPOE
} orig_proto; } orig_proto:8;
bool pkt_otherhost; bool pkt_otherhost;
unsigned int mask; unsigned int mask;
struct net_device *physindev; struct net_device *physindev;
struct net_device *physoutdev; union {
char neigh_header[8]; struct net_device *physoutdev;
char neigh_header[8];
};
}; };
#endif #endif
......
...@@ -973,6 +973,8 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb) ...@@ -973,6 +973,8 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
nf_bridge->neigh_header, nf_bridge->neigh_header,
ETH_HLEN - ETH_ALEN); ETH_HLEN - ETH_ALEN);
skb->dev = nf_bridge->physindev; skb->dev = nf_bridge->physindev;
nf_bridge->physoutdev = NULL;
br_handle_frame_finish(NULL, skb); br_handle_frame_finish(NULL, 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