OSDN Git Service

[PATCH] Bridge STP timer fixes
authorStephen Hemminger <shemminger@linux-foundation.org>
Tue, 21 Aug 2007 18:53:21 +0000 (11:53 -0700)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2007 17:43:07 +0000 (18:43 +0100)
Fix a couple of obvious places in 2.4 code where bridge timers are
set to values < current jiffies. This was a bug (mostly harmless)
that makes timer fires too soon.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
net/bridge/br_stp.c

index 3de15aa..50c7fe3 100644 (file)
@@ -141,7 +141,7 @@ void br_become_root_bridge(struct net_bridge *br)
        br_topology_change_detection(br);
        br_timer_clear(&br->tcn_timer);
 
-       br_timer_set(&br->hello_timer, jiffies - br->hello_time);
+       br_timer_set(&br->hello_timer, jiffies + br->hello_time);
 }
 
 /* called under bridge lock */
@@ -193,7 +193,8 @@ static void br_record_config_information(struct net_bridge_port *p, struct br_co
        p->designated_bridge = bpdu->bridge_id;
        p->designated_port = bpdu->port_id;
 
-       br_timer_set(&p->message_age_timer, jiffies - bpdu->message_age);
+       br_timer_set(&p->message_age_timer, jiffies + 
+                    (p->br->max_age - bpdu->message_age));
 }
 
 /* called under bridge lock */