diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-07-22 03:47:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-22 20:01:12 -0400 |
commit | 0652cac22ce3fa0c90e35d0a2862969fc394cb02 (patch) | |
tree | cb4aa33271758c13924999dd43fc32664f212b1b /net/bridge | |
parent | 0c03150e7ea8f7fcd03cfef29385e0010b22ee92 (diff) |
bridge: ignore bogus STP config packets
If the message_age is already greater than the max_age, then the
BPDU is bogus. Linux won't generate BPDU, but conformance tester
or buggy implementation might.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_stp_bpdu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index 289646ec9b7b..b69232b3718b 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c | |||
@@ -210,6 +210,17 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb, | |||
210 | bpdu.hello_time = br_get_ticks(buf+28); | 210 | bpdu.hello_time = br_get_ticks(buf+28); |
211 | bpdu.forward_delay = br_get_ticks(buf+30); | 211 | bpdu.forward_delay = br_get_ticks(buf+30); |
212 | 212 | ||
213 | if (bpdu.message_age > bpdu.max_age) { | ||
214 | if (net_ratelimit()) | ||
215 | br_notice(p->br, | ||
216 | "port %u config from %pM" | ||
217 | " (message_age %ul > max_age %ul)\n", | ||
218 | p->port_no, | ||
219 | eth_hdr(skb)->h_source, | ||
220 | bpdu.message_age, bpdu.max_age); | ||
221 | goto out; | ||
222 | } | ||
223 | |||
213 | br_received_config_bpdu(p, &bpdu); | 224 | br_received_config_bpdu(p, &bpdu); |
214 | } | 225 | } |
215 | 226 | ||