[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1334737434.2472.95.camel@edumazet-glaptop>
Date: Wed, 18 Apr 2012 10:23:54 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: "Peter Huang(Peng)" <peter.huangpeng@...wei.com>
Cc: Stephen Hemminger <shemminger@...tta.com>,
"'David S. Miller'" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, ctrix+debianbugs@...ynet.it,
peter.huangpeng@...il.com, harry.majun@...wei.com
Subject: Re: [PATCH] set fake_rtable's dst to NULL to avoid kernel Oops.
On Wed, 2012-04-18 at 15:57 +0800, Peter Huang(Peng) wrote:
> On 2012/4/18 0:48, Eric Dumazet wrote:
> > On Tue, 2012-04-17 at 08:52 -0700, Stephen Hemminger wrote:
> >
> >> This check seems like a disaster waiting to happen when the next
> >> change to DST table happens.
> >
> > Please Peter Document this, adding a new DST_FAKE_RTABLE flag
> >
> > #define DST_FAKE_RTABLE DST_NOPEER
> >
> > or just use a bit, we have plenty of them available.
> >
>
>
> Add DST_FAKE_RTABLE to dst_entry, this is the new patch.
> Is this ok?
>
A full new patch is needed, with nice changelog, and proper formatting
(your mail was mangled)
> };
>
> +static inline void br_drop_fake_rtable(struct sk_buff *skb) {
> + struct dst_entry *dst = skb_dst(skb);
> + /* abuse fact that only fake_rtable has DST_FAKE_RTABLE set */
Remove the comment, since we dont abuse NOPEER anymore, we use a
dedicated flag. (keep an empty line)
> + if (dst && (dst->flags & DST_FAKE_RTABLE))
> + skb_dst_drop(skb);
> +}
> +
> #else
> #define nf_bridge_maybe_copy_header(skb) (0)
> #define nf_bridge_pad(skb) (0)
> +#define br_drop_fake_rtable(skb) (0)
> #endif /* CONFIG_BRIDGE_NETFILTER */
>
> #endif /* __KERNEL__ */
> diff --git a/include/net/dst.h b/include/net/dst.h
> index 59c5d18..b094030 100644
> --- a/include/net/dst.h
> +++ b/include/net/dst.h
> @@ -55,6 +55,7 @@ struct dst_entry {
> #define DST_NOCACHE 0x0010
> #define DST_NOCOUNT 0x0020
> #define DST_NOPEER 0x0040
> +#define DST_FAKE_RTABLE 0x0080
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists