From: dv1tas Date: Wed, 17 Jul 2013 08:15:19 +0000 (+0000) Subject: In BPDUs use configured Hello_Time, not received from other bridge X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b14bad4888a5c3776a9fc9889e759dbd4d6c00ee;p=people%2Fms%2Fmstpd.git In BPDUs use configured Hello_Time, not received from other bridge >> RSTP-8.1 Tue Apr 30 13:33:08 2013: TEST_DESCRIPTION If the physical connectivity of the network or management parameters change, new spanning tree information will propagate rapidly. Each Bridge accepts better information from any Bridge on a LAN or revised information from the prior Designated Bridge for that LAN. Updated Configuration Messages are transmitted through Designated Ports, until the leaves of the Spanning Tree defined by a new configuration are reached. AND The designatedTimes (17.19.5) for each Port, set equal to the value of rootTimes, except for the Hello Time component, which is set equal to BridgeTime's Hello Time Tue Apr 30 13:33:08 2013: TEST_REFERENCE IEEE Std 802.1D-2004 S17.9 P145 Changing Spanning Tree Information IEEE Std 802.1D-2004 S17.21.25 P169 updtRolesTree() Failure: ! Hello time in the received RST BPDU incorrectly set ! Expected Value : 2.000 ! Received Value : 3.000 Reported-by: Satish Ashok Signed-off-by: Vitalii Demianets Reviewed-by: Satish Ashok git-svn-id: svn://svn.code.sf.net/p/mstpd/code/trunk@58 fbe50366-0c72-4402-a84b-5d246361dba7 --- diff --git a/mstp.c b/mstp.c index 3b3feea..dbf07ae 100644 --- a/mstp.c +++ b/mstp.c @@ -920,6 +920,11 @@ int MSTP_IN_set_cist_bridge_config(bridge_t *br, CIST_BridgeConfig *cfg) { ptp->selected = false; ptp->reselect = true; + /* TODO: change this when Hello_Time will be configurable + * per-port. For now, copy Bridge's Hello_Time + * to the port's Hello_Time. + */ + assign(ptp->portTimes.Hello_Time, br->Hello_Time); } } } @@ -2090,10 +2095,18 @@ static void recordProposal(per_tree_port_t *ptp) /* 13.26.11 recordTimes */ static void recordTimes(per_tree_port_t *ptp) { + /* 802.1Q-2005 and 802.1D-2004 both say that we have to copy + * Hello_Time from msgTimes to portTimes. + * 802.1Q-2011, on the other hand, says that Hello_Time should be set + * to the default here. + * As we have configurable Hello_Time, I choose the third option: + * preserve the configured Hello_Time, It is in accordance with the + * spirit of 802.1Q-2011, if we allow Hello_Time to be configurable. + */ + __u8 prev_Hello_Time; + assign(prev_Hello_Time, ptp->portTimes.Hello_Time); assign(ptp->portTimes, ptp->msgTimes); - - if(MIN_COMPAT_HELLO_TIME > ptp->portTimes.Hello_Time) - ptp->portTimes.Hello_Time = MIN_COMPAT_HELLO_TIME; + assign(ptp->portTimes.Hello_Time, prev_Hello_Time); } /* 13.24.s) + 17.19.7 of 802.1D : fdbFlush */ @@ -2643,6 +2656,13 @@ static void updtRolesTree(tree_t *tree) /* e) Set new designatedTimes */ assign(ptp->designatedTimes, tree->rootTimes); + /* Keep the configured Hello_Time for the port. + * NOTE: this is in accordance with the spirit of 802.1D-2004. + * Also, this does not contradict 802.1Q-2005(-2011), as in these + * standards both designatedTimes and rootTimes structures + * don't have Hello_Time member. + */ + assign(ptp->designatedTimes.Hello_Time, ptp->portTimes.Hello_Time); } /* syncMaster */ diff --git a/mstp.h b/mstp.h index 6443efc..2e7caad 100644 --- a/mstp.h +++ b/mstp.h @@ -106,9 +106,6 @@ typedef struct __be32 ExtRootPathCost; } port_priority_vector_t; -/* 17.14 of 802.1D, Table 17-1 */ -#define MIN_COMPAT_HELLO_TIME 1 - typedef struct { __u8 remainingHops;