* [PATCH -next] netfilter: bridge: neigh_head and physoutdev can't be used at same time
@ 2015-05-03 20:05 Florian Westphal
2015-05-14 10:52 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2015-05-03 20:05 UTC (permalink / raw)
To: netfilter-devel; +Cc: Florian Westphal
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: Florian Westphal <fw@strlen.de>
---
include/linux/skbuff.h | 8 +++++---
net/bridge/br_netfilter.c | 2 ++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 66e374d..2cea360 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -170,12 +170,14 @@ struct nf_bridge_info {
BRNF_PROTO_UNCHANGED,
BRNF_PROTO_8021Q,
BRNF_PROTO_PPPOE
- } orig_proto;
+ } orig_proto:8;
bool pkt_otherhost;
unsigned int mask;
struct net_device *physindev;
- struct net_device *physoutdev;
- char neigh_header[8];
+ union {
+ struct net_device *physoutdev;
+ char neigh_header[8];
+ };
};
#endif
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index ab55e24..13973da 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -973,6 +973,8 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
nf_bridge->neigh_header,
ETH_HLEN - ETH_ALEN);
skb->dev = nf_bridge->physindev;
+
+ nf_bridge->physoutdev = NULL;
br_handle_frame_finish(NULL, skb);
}
--
2.0.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] netfilter: bridge: neigh_head and physoutdev can't be used at same time
2015-05-03 20:05 [PATCH -next] netfilter: bridge: neigh_head and physoutdev can't be used at same time Florian Westphal
@ 2015-05-14 10:52 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2015-05-14 10:52 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
On Sun, May 03, 2015 at 10:05:28PM +0200, Florian Westphal wrote:
> 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.
Applied, thanks for your patience.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-14 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-03 20:05 [PATCH -next] netfilter: bridge: neigh_head and physoutdev can't be used at same time Florian Westphal
2015-05-14 10:52 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).