From: Eric Dumazet Date: Tue, 12 Apr 2011 20:39:14 +0000 (-0700) Subject: bridge: reset IPCB in br_parse_ip_options X-Git-Tag: v2.6.38.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6935b2f7905bc973676cec541c1ebbbd3bd5692f;p=thirdparty%2Fkernel%2Fstable.git bridge: reset IPCB in br_parse_ip_options commit f8e9881c2aef1e982e5abc25c046820cd0b7cf64 upstream. Commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP stack), missed one IPCB init before calling ip_options_compile() Thanks to Scot Doyle for his tests and bug reports. Reported-by: Scot Doyle Signed-off-by: Eric Dumazet Cc: Hiroaki SHIMODA Acked-by: Bandan Das Acked-by: Stephen Hemminger Cc: Jan Lübbe Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 49d50ea5dbbc6..333bcaa1377c6 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -249,11 +249,9 @@ static int br_parse_ip_options(struct sk_buff *skb) goto drop; } - /* Zero out the CB buffer if no options present */ - if (iph->ihl == 5) { - memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); + memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); + if (iph->ihl == 5) return 0; - } opt->optlen = iph->ihl*4 - sizeof(struct iphdr); if (ip_options_compile(dev_net(dev), opt, skb))