[BRIDGE]: port timer initialization
authorStephen Hemminger <shemminger@osdl.org>
Sat, 4 Mar 2006 01:15:34 +0000 (17:15 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 5 Mar 2006 05:06:21 +0000 (21:06 -0800)
Initialize the STP timers for a port when it is created,
rather than when it is enabled. This will prevent future race conditions
where timer gets started before port is enabled.

Signed-off-by: Stephen Hemminger <shemmigner@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_if.c
net/bridge/br_stp_if.c

index 8b38c839d539e68e5c6538fd08f17c9f37caceee..879b54ed2b4e3e94aa9432412e192f8b3b16b389 100644 (file)
@@ -277,8 +277,9 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
        br_init_port(p);
        p->state = BR_STATE_DISABLED;
        INIT_WORK(&p->carrier_check, port_carrier_check, dev);
-       kobject_init(&p->kobj);
+       br_stp_port_timer_init(p);
 
+       kobject_init(&p->kobj);
        kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
        p->kobj.ktype = &brport_ktype;
        p->kobj.parent = &(dev->class_dev.kobj);
index 35cf3a07408725608f368ccfe97e338b3ab9e678..23dea1422c9a90873c13145ae52f7287afcb9633 100644 (file)
@@ -39,8 +39,6 @@ void br_init_port(struct net_bridge_port *p)
        p->state = BR_STATE_BLOCKING;
        p->topology_change_ack = 0;
        p->config_pending = 0;
-
-       br_stp_port_timer_init(p);
 }
 
 /* called under bridge lock */