Re: çå: çå: çå:[PATCH] set fake_rtable's dst to NULL to avoid kernel Oops.

From: Eric Dumazet
Date: Sat Mar 31 2012 - 01:41:34 EST


On Sat, 2012-03-31 at 09:26 +0800, Peter Huang (Peng) wrote:
> > > >Check net/bridge/br_netfilter.c and commits e688a6048076 (net: introduce
> > > >DST_NOPEER dst flag ) 4adf0af6818f3ea5 (bridge: send correct MTU value
> > > >in PMTU (revised))
>
> Hi, Eric
>
> I confirmed the patch contents again.
> For our case, NF_INET_PRE_ROUTING is involved, not NF_BR_LOCAL_IN.
> It seems pre-routing is not included in the patch you mentioned.
> BTW, our pkts are all ipv6 DHCP pkts(with MAC 33 33 00 01 00 02).
>
> We verified the patch bellow, and this works fine, no WARN_ON happened.

Hi Peter

I claim that your patch is not the good one and you need to refine it.

First, code is not needed if CONFIG_BRIDGE_NETFILTER is not set.

In fact, if CONFIG_BRIDGE_NETFILTER is not set, compilation will fail
since fake_rtable doesnt exist in "struct net_bridge", so you fix a bug
and introduce a new one.

CC [M] net/bridge/br_forward.o
net/bridge/br_forward.c: In function â__br_forwardâ:
net/bridge/br_forward.c:94: error: âstruct sk_buffâ has no member named â_skb_dstâ
net/bridge/br_forward.c:94: error: âstruct net_bridgeâ has no member named âfake_rtableâ
make[1]: *** [net/bridge/br_forward.o] Error 1
make: *** [_module_net/bridge] Error 2


Then, the test is using obsolete dst internals and cast that should not
be in a C file. :

if (skb->_skb_dst == (unsigned long)&to->br->fake_rtable)

So I suggested you take a look at net/bridge/br_netfilter.c code to see
how this can be done properly. Maybe you need to add a helper in an
include file to make this proper.

I hope this is now clear to you, because your initial patch cannot be
applied as is. If you want full credit for this work, you must go a step
forward, or else another guy will finish the job.

Thanks


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/