diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-07-05 17:29:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-07 17:43:33 -0400 |
commit | 17762060c25590bfddd68cc1131f28ec720f405f (patch) | |
tree | 20f774e21264c70a7d6690377db4cddd811278fc /net | |
parent | 7f285fa78d4b81b8458f05e77fb6b46245121b4e (diff) |
bridge: Clear IPCB before possible entry into IP stack
The bridge protocol lives dangerously by having incestuous relations
with the IP stack. In this instance an abomination has been created
where a bogus IPCB area from a bridged packet leads to a crash in
the IP stack because it's interpreted as IP options.
This patch papers over the problem by clearing the IPCB area in that
particular spot. To fix this properly we'd also need to parse any
IP options if present but I'm way too lazy for that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 44420992f72f..8fb75f89c4aa 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -591,6 +591,9 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb, | |||
591 | 591 | ||
592 | pskb_trim_rcsum(skb, len); | 592 | pskb_trim_rcsum(skb, len); |
593 | 593 | ||
594 | /* BUG: Should really parse the IP options here. */ | ||
595 | memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); | ||
596 | |||
594 | nf_bridge_put(skb->nf_bridge); | 597 | nf_bridge_put(skb->nf_bridge); |
595 | if (!nf_bridge_alloc(skb)) | 598 | if (!nf_bridge_alloc(skb)) |
596 | return NF_DROP; | 599 | return NF_DROP; |