public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] [2.6.7] Bridge - Fix BPDU message_age
@ 2004-06-22 14:51 Kishore A K
  0 siblings, 0 replies; 2+ messages in thread
From: Kishore A K @ 2004-06-22 14:51 UTC (permalink / raw)
  To: shemminger; +Cc: bridge, linux-kernel

Fixes message_age field update in config BPDUs. Also checks whether the BPDU 
message age has exceeded bridge max age before transmitting config BPDUs.

Signed-off-by: Kishore A K <KishoreAK@myw.ltindia.com>

Index: linux-2.6.7/net/bridge/br_stp.c
=============================================================

--- linux-2.6.7/net/bridge/br_stp.c.orig	2004-06-17 20:17:27.000000000 +0530
+++ linux-2.6.7/net/bridge/br_stp.c	2004-06-22 19:32:49.015908632 +0530
@@ -161,20 +161,19 @@ void br_transmit_config(struct net_bridg
 	if (!br_is_root_bridge(br)) {
 		struct net_bridge_port *root
 			= br_get_port(br, br->root_port);
-		bpdu.max_age = root->message_age_timer.expires - jiffies;
-
-		if (bpdu.max_age <= 0) bpdu.max_age = 1;
+		bpdu.message_age = br->max_age - 
+			(root->message_age_timer.expires - jiffies) + 1;
 	}
 	bpdu.max_age = br->max_age;
 	bpdu.hello_time = br->hello_time;
 	bpdu.forward_delay = br->forward_delay;
 
-	br_send_config_bpdu(p, &bpdu);
-
-	p->topology_change_ack = 0;
-	p->config_pending = 0;
-	
-	mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+	if (bpdu.message_age < br->max_age) {
+		br_send_config_bpdu(p, &bpdu);
+		p->topology_change_ack = 0;
+		p->config_pending = 0;
+		mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+	}
 }
 
 /* called under bridge lock */



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Patch] [2.6.7] Bridge - Fix BPDU message_age
@ 2004-06-23  6:44 Kishore A K
  0 siblings, 0 replies; 2+ messages in thread
From: Kishore A K @ 2004-06-23  6:44 UTC (permalink / raw)
  To: linux-kernel

Fixes message_age field update in config BPDUs. Also checks whether the BPDU 
message age has exceeded bridge max age before transmitting config BPDUs.

Signed-off-by: Kishore A K <KishoreAK@myw.ltindia.com>

Index: linux-2.6.7/net/bridge/br_stp.c
=============================================================

--- linux-2.6.7/net/bridge/br_stp.c.orig    2004-06-17 20:17:27.000000000 +0530
+++ linux-2.6.7/net/bridge/br_stp.c    2004-06-22 19:32:49.015908632 +0530
@@ -161,20 +161,19 @@ void br_transmit_config(struct net_bridg
    if (!br_is_root_bridge(br)) {
        struct net_bridge_port *root
            = br_get_port(br, br->root_port);
-        bpdu.max_age = root->message_age_timer.expires - jiffies;
-
-        if (bpdu.max_age <= 0) bpdu.max_age = 1;
+        bpdu.message_age = br->max_age - 
+            (root->message_age_timer.expires - jiffies) + 1;
    }
    bpdu.max_age = br->max_age;
    bpdu.hello_time = br->hello_time;
    bpdu.forward_delay = br->forward_delay;

-    br_send_config_bpdu(p, &bpdu);
-
-    p->topology_change_ack = 0;
-    p->config_pending = 0;
-    
-    mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+    if (bpdu.message_age < br->max_age) {
+        br_send_config_bpdu(p, &bpdu);
+        p->topology_change_ack = 0;
+        p->config_pending = 0;
+        mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+    }
}

/* called under bridge lock */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-23  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23  6:44 [Patch] [2.6.7] Bridge - Fix BPDU message_age Kishore A K
  -- strict thread matches above, loose matches on Subject: below --
2004-06-22 14:51 Kishore A K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox