aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-11-24 19:06:50 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-24 19:06:50 -0500
commit631339f1e544a4d39a63cfe6708c5bddcd5a2c48 (patch)
treed3b20999303ea2af64b364b63bb176e0fd5d8e4e /net/bridge
parentf79fca55f9a6fe54635ad32ddc8a38f92a94ec30 (diff)
bridge: netfilter: fix update_pmtu crash with GRE
As GRE tries to call the update_pmtu function on skb->dst and bridge supplies an skb->dst that has a NULL ops field, all is not well. This patch fixes this by giving the bridge device an ops field with an update_pmtu function. For the moment I've left all other fields blank but we can fill them in later should the need arise. Based on report and patch by Philip Craig. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index fa5cda4e552a..45f61c348e36 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -101,6 +101,18 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb)
101 pppoe_proto(skb) == htons(PPP_IPV6) && \ 101 pppoe_proto(skb) == htons(PPP_IPV6) && \
102 brnf_filter_pppoe_tagged) 102 brnf_filter_pppoe_tagged)
103 103
104static void fake_update_pmtu(struct dst_entry *dst, u32 mtu)
105{
106}
107
108static struct dst_ops fake_dst_ops = {
109 .family = AF_INET,
110 .protocol = __constant_htons(ETH_P_IP),
111 .update_pmtu = fake_update_pmtu,
112 .entry_size = sizeof(struct rtable),
113 .entries = ATOMIC_INIT(0),
114};
115
104/* 116/*
105 * Initialize bogus route table used to keep netfilter happy. 117 * Initialize bogus route table used to keep netfilter happy.
106 * Currently, we fill in the PMTU entry because netfilter 118 * Currently, we fill in the PMTU entry because netfilter
@@ -117,6 +129,7 @@ void br_netfilter_rtable_init(struct net_bridge *br)
117 rt->u.dst.path = &rt->u.dst; 129 rt->u.dst.path = &rt->u.dst;
118 rt->u.dst.metrics[RTAX_MTU - 1] = 1500; 130 rt->u.dst.metrics[RTAX_MTU - 1] = 1500;
119 rt->u.dst.flags = DST_NOXFRM; 131 rt->u.dst.flags = DST_NOXFRM;
132 rt->u.dst.ops = &fake_dst_ops;
120} 133}
121 134
122static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) 135static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)