public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kishore A K" <kishoreak@myw.ltindia.com>
To: <shemminger@osdl.org>
Cc: <bridge@lists.osdl.org>, <linux-kernel@vger.kernel.org>
Subject: [Patch] [2.6.7] Bridge - Fix BPDU message_age
Date: Tue, 22 Jun 2004 20:21:24 +0530	[thread overview]
Message-ID: <s0d894d5.036@EMAIL> (raw)

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 */



             reply	other threads:[~2004-06-22 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-22 14:51 Kishore A K [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-23  6:44 [Patch] [2.6.7] Bridge - Fix BPDU message_age Kishore A K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s0d894d5.036@EMAIL \
    --to=kishoreak@myw.ltindia.com \
    --cc=bridge@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox