diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-05-24 13:32:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-03 09:31:56 +0900 |
commit | 42923465fb8d025a2b5153f2e7ab1e6e1058bf00 (patch) | |
tree | 5a8354f01ba5f08431efe2f755478f883f831d09 | |
parent | 40093a2a3e53af2f1a0754fe40b7513ebf6e0c8f (diff) | |
download | lwn-42923465fb8d025a2b5153f2e7ab1e6e1058bf00.tar.gz lwn-42923465fb8d025a2b5153f2e7ab1e6e1058bf00.zip |
bridge: initialize fake_rtable metrics
[ Upstream commit 33eb9873a283a2076f2b5628813d5365ca420ea9 ]
bridge netfilter code uses a fake_rtable, and we must init its _metric
field or risk NULL dereference later.
Ref: https://bugzilla.kernel.org/show_bug.cgi?id=35672
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/bridge/br_netfilter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 74ef4d4846a4..5f9c0913a16e 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -117,6 +117,10 @@ static struct dst_ops fake_dst_ops = { * ipt_REJECT needs it. Future netfilter modules might * require us to fill additional fields. */ +static const u32 br_dst_default_metrics[RTAX_MAX] = { + [RTAX_MTU - 1] = 1500, +}; + void br_netfilter_rtable_init(struct net_bridge *br) { struct rtable *rt = &br->fake_rtable; @@ -124,7 +128,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) atomic_set(&rt->dst.__refcnt, 1); rt->dst.dev = br->dev; rt->dst.path = &rt->dst; - dst_metric_set(&rt->dst, RTAX_MTU, 1500); + dst_init_metrics(&rt->dst, br_dst_default_metrics, true); rt->dst.flags = DST_NOXFRM; rt->dst.ops = &fake_dst_ops; } |