X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=net%2Fbridge%2Fbr_stp.c;h=6e63ec3f1fcfc1f646eeee4fc0454bf79e69396f;hb=f3d8b2e467da7a9237a45248ff03b56b6a7c3df7;hp=ebb0861e9bd573959eb2a4c1bdb7ef00cbcc3454;hpb=9cde070874b822d4677f4f01fe146991785813b1;p=safe%2Fjmp%2Flinux-2.6 diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index ebb0861..6e63ec3 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c @@ -5,15 +5,13 @@ * Authors: * Lennert Buytenhek * - * $Id: br_stp.c,v 1.4 2000/06/19 10:13:35 davem Exp $ - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include -#include +#include #include "br_private.h" #include "br_private_stp.h" @@ -179,7 +177,8 @@ void br_transmit_config(struct net_bridge_port *p) br_send_config_bpdu(p, &bpdu); p->topology_change_ack = 0; p->config_pending = 0; - mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME); + mod_timer(&p->hold_timer, + round_jiffies(jiffies + BR_HOLD_TIME)); } } @@ -369,14 +368,25 @@ static void br_make_blocking(struct net_bridge_port *p) /* called under bridge lock */ static void br_make_forwarding(struct net_bridge_port *p) { - if (p->state == BR_STATE_BLOCKING) { - if (p->br->stp_enabled == BR_KERNEL_STP) - p->state = BR_STATE_LISTENING; - else - p->state = BR_STATE_LEARNING; + struct net_bridge *br = p->br; - br_log_state(p); - mod_timer(&p->forward_delay_timer, jiffies + p->br->forward_delay); } + if (p->state != BR_STATE_BLOCKING) + return; + + if (br->forward_delay == 0) { + p->state = BR_STATE_FORWARDING; + br_topology_change_detection(br); + del_timer(&p->forward_delay_timer); + } + else if (p->br->stp_enabled == BR_KERNEL_STP) + p->state = BR_STATE_LISTENING; + else + p->state = BR_STATE_LEARNING; + + br_log_state(p); + + if (br->forward_delay != 0) + mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay); } /* called under bridge lock */