Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
[pandora-kernel.git] / net / bridge / br_stp_bpdu.c
index 289646e..e16aade 100644 (file)
@@ -210,10 +210,19 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
                bpdu.hello_time = br_get_ticks(buf+28);
                bpdu.forward_delay = br_get_ticks(buf+30);
 
-               br_received_config_bpdu(p, &bpdu);
-       }
+               if (bpdu.message_age > bpdu.max_age) {
+                       if (net_ratelimit())
+                               br_notice(p->br,
+                                         "port %u config from %pM"
+                                         " (message_age %ul > max_age %ul)\n",
+                                         p->port_no,
+                                         eth_hdr(skb)->h_source,
+                                         bpdu.message_age, bpdu.max_age);
+                       goto out;
+               }
 
-       else if (buf[0] == BPDU_TYPE_TCN) {
+               br_received_config_bpdu(p, &bpdu);
+       } else if (buf[0] == BPDU_TYPE_TCN) {
                br_received_tcn_bpdu(p);
        }
  out: