mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Stephen Hemminger <shemminger@vyatta.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [69/70] bridge: send proper message_age in config BPDU
Date: Mon, 01 Aug 2011 16:19:24 -0700	[thread overview]
Message-ID: <20110801232057.540698730@clark.kroah.org> (raw)
In-Reply-To: <20110801232124.GA15313@kroah.com>

2.6.39-stable review patch.  If anyone has any objections, please let us know.

------------------

From: stephen hemminger <shemminger@vyatta.com>

commit 0c03150e7ea8f7fcd03cfef29385e0010b22ee92 upstream.

A bridge topology with three systems:

      +------+  +------+
      | A(2) |--| B(1) |
      +------+  +------+
           \    /
          +------+
          | C(3) |
          +------+

What is supposed to happen:
 * bridge with the lowest ID is elected root (for example: B)
 * C detects that A->C is higher cost path and puts in blocking state

What happens. Bridge with lowest id (B) is elected correctly as
root and things start out fine initially. But then config BPDU
doesn't get transmitted from A -> C. Because of that
the link from A-C is transistioned to the forwarding state.

The root cause of this is that the configuration messages
is generated with bogus message age, and dropped before
sending.

In the standardmessage_age is supposed to be:
  the time since the generation of the Configuration BPDU by
  the Root that instigated the generation of this Configuration BPDU.

Reimplement this by recording the timestamp (age + jiffies) when
recording config information. The old code incorrectly used the time
elapsed on the ageing timer which was incorrect.

See also:
  https://bugzilla.vyatta.com/show_bug.cgi?id=7164

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bridge/br_private.h |    1 +
 net/bridge/br_stp.c     |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -123,6 +123,7 @@ struct net_bridge_port
 	bridge_id			designated_bridge;
 	u32				path_cost;
 	u32				designated_cost;
+	unsigned long			designated_age;
 
 	struct timer_list		forward_delay_timer;
 	struct timer_list		hold_timer;
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -164,8 +164,7 @@ void br_transmit_config(struct net_bridg
 	else {
 		struct net_bridge_port *root
 			= br_get_port(br, br->root_port);
-		bpdu.message_age = br->max_age
-			- (root->message_age_timer.expires - jiffies)
+		bpdu.message_age = (jiffies - root->designated_age)
 			+ MESSAGE_AGE_INCR;
 	}
 	bpdu.max_age = br->max_age;
@@ -189,6 +188,7 @@ static inline void br_record_config_info
 	p->designated_cost = bpdu->root_path_cost;
 	p->designated_bridge = bpdu->bridge_id;
 	p->designated_port = bpdu->port_id;
+	p->designated_age = jiffies + bpdu->message_age;
 
 	mod_timer(&p->message_age_timer, jiffies
 		  + (p->br->max_age - bpdu->message_age));



  parent reply	other threads:[~2011-08-01 23:27 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 23:21 [00/70] 2.6.39.4-stable review Greg KH
2011-08-01 23:18 ` [01/70] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-01 23:18 ` [02/70] drm/radeon/kms: free ib pool on module unloading Greg KH
2011-08-01 23:18 ` [03/70] drm/radeon/kms: fix typo in evergreen disp int status register Greg KH
2011-08-01 23:18 ` [04/70] drm/radeon/kms: fix typo in IH_CNTL swap bitfield Greg KH
2011-08-01 23:18 ` [05/70] mm: vmscan: correct check for kswapd sleeping in sleeping_prematurely Greg KH
2011-08-01 23:18 ` [06/70] mm/nommu.c: fix remap_pfn_range() Greg KH
2011-08-01 23:18 ` [07/70] mm: vmscan: evaluate the watermarks against the correct classzone Greg KH
2011-08-01 23:18 ` [08/70] hwmon: (lm95241) Fix chip detection code Greg KH
2011-08-01 23:18 ` [09/70] hwmon: (lm95241) Fix negative temperature results Greg KH
2011-08-01 23:18 ` [10/70] hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes Greg KH
2011-08-01 23:18 ` [11/70] hwmon: (pmbus) Drop check for PMBus revision register in probe function Greg KH
2011-08-01 23:18 ` [12/70] hwmon: (pmbus) Improve fan detection Greg KH
2011-08-01 23:18 ` [13/70] hwmon: (pmbus) Use long variables for register to data conversions Greg KH
2011-08-01 23:18 ` [14/70] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
2011-08-01 23:18 ` [15/70] ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting Greg KH
2011-08-01 23:18 ` [16/70] ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2 Greg KH
2011-08-01 23:18 ` [17/70] ARM: 6989/1: perf: do not start the PMU when no events are present Greg KH
2011-08-01 23:18 ` [18/70] ARM: pxa168: correct nand pmu setting Greg KH
2011-08-01 23:18 ` [19/70] ARM: pxa910: " Greg KH
2011-08-01 23:18 ` [20/70] ARM: pxa: fix PGSR register address calculation Greg KH
2011-08-01 23:18 ` [21/70] firewire: ohci: do not bind to Pinnacle cards, avert panic Greg KH
2011-08-01 23:18 ` [22/70] Revert: "dell-laptop: Toggle the unsupported hardware killswitch" Greg KH
2011-08-01 23:18 ` [23/70] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner Greg KH
2011-08-01 23:18 ` [24/70] [media] tuner-core: fix s_std and s_tuner Greg KH
2011-08-01 23:18 ` [25/70] [media] tuner-core: fix tuner_resume: use t->mode instead of t->type Greg KH
2011-08-01 23:18 ` [26/70] hwmon: (pmbus) Improve auto-detection of temperature status register Greg KH
2011-08-01 23:18 ` [27/70] [media] pvrusb2: fix g/s_tuner support Greg KH
2011-08-01 23:18 ` [28/70] [media] bttv: fix s_tuner for radio Greg KH
2011-08-01 23:18 ` [29/70] fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops Greg KH
2011-08-01 23:18 ` [30/70] drm/radeon/kms: fix backend map typo on juniper Greg KH
2011-08-01 23:18 ` [31/70] NFSv4.1: update nfs4_fattr_bitmap_maxsz Greg KH
2011-08-01 23:18 ` [32/70] mac80211: fix TKIP replay vulnerability Greg KH
2011-08-01 23:18 ` [33/70] carl9170: add NEC WL300NU-AG usbid Greg KH
2011-08-01 23:18 ` [34/70] rtlwifi: rtl8192cu: Add new USB ID for Netgear WNA1000M Greg KH
2011-08-01 23:18 ` [35/70] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
2011-08-01 23:18 ` [36/70] SUNRPC: Fix use of static variable in rpcb_getport_async Greg KH
2011-08-01 23:18 ` [37/70] drm/radeon/kms: add new NI pci ids Greg KH
2011-08-01 23:18 ` [38/70] ath9k: Fix tx throughput drops for AR9003 chips with AES encryption Greg KH
2011-08-01 23:18 ` [39/70] ath5k: fix incorrect use of drvdata in sysfs code Greg KH
2011-08-01 23:18 ` [40/70] ath5k: fix incorrect use of drvdata in PCI suspend/resume code Greg KH
2011-08-01 23:18 ` [41/70] drm/radeon/kms: clean up multiple crtc handling for Greg KH
2011-08-01 23:18 ` [42/70] drm/radeon: fix oops in ttm reserve when pageflipping (v2) Greg KH
2011-08-01 23:18 ` [43/70] GFS2: make sure fallocate bytes is a multiple of blksize Greg KH
2011-08-01 23:18 ` [44/70] [media] Revert "V4L/DVB: cx23885: Enable Message Signaled Interrupts(MSI)" Greg KH
2011-08-01 23:19 ` [45/70] si4713-i2c: avoid potential buffer overflow on si4713 Greg KH
2011-08-01 23:19 ` [46/70] ASoC: Correct WM8994 MICBIAS supply widget hookup Greg KH
2011-08-01 23:19 ` [47/70] ASoC: Fix shift in WM8958 accessory detection default Greg KH
2011-08-01 23:19 ` [48/70] hwmon: (it87) Fix label group removal Greg KH
2011-08-01 23:19 ` [49/70] hwmon: (asus_atk0110) Fix memory leak Greg KH
2011-08-01 23:19 ` [50/70] hwmon: (max1111) Fix race condition causing NULL pointer exception Greg KH
2011-08-01 23:19 ` [51/70] mmc: Added quirks for Ricoh 1180:e823 lower base clock Greg KH
2011-08-01 23:19 ` [52/70] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get Greg KH
2011-08-01 23:19 ` [53/70] x86: Make Dell Latitude E5420 use reboot=pci Greg KH
2011-08-01 23:19 ` [54/70] davinci: DM365 EVM: fix video input mux bits Greg KH
2011-08-01 23:19 ` [55/70] vmscan: fix a livelock in kswapd Greg KH
2011-08-01 23:19 ` [56/70] libata: fix unexpectedly frozen port after ata_eh_reset() Greg KH
2011-08-01 23:19 ` [57/70] ext4: fix oops in ext4_quota_off() Greg KH
2011-08-01 23:19 ` [58/70] mm: compaction: ensure that the compaction free scanner does not move to the next zone Greg KH
2011-08-01 23:19 ` [59/70] mm: vmscan: do not use page_count without a page pin Greg KH
2011-08-01 23:19 ` [60/70] [stable] [PATCH 3/3] mm: compaction: abort compaction if too many pages are isolated and caller is asynchronous V2 Greg KH
2011-08-01 23:19 ` [61/70] xfs [stable only]: restart busy extent search after node removal Greg KH
2011-08-01 23:19 ` [62/70] cifs: clean up wsize negotiation and allow for larger wsize Greg KH
2011-08-01 23:19 ` [63/70] mm: vmscan: do not apply pressure to slab if we are not applying pressure to zone Greg KH
2011-08-01 23:19 ` [64/70] mm: vmscan: only read new_classzone_idx from pgdat when reclaiming successfully Greg KH
2011-08-01 23:19 ` [65/70] Revert "DiBxxxx: get rid of DMA buffer on stack" Greg KH
2011-08-01 23:19 ` [66/70] vfs: fix race in rcu lookup of pruned dentry Greg KH
2011-08-01 23:19 ` [67/70] cifs: fix wsize negotiation to respect max buffer size and Greg KH
2011-08-01 23:19 ` [68/70] cifs: lower default and max wsize to what 2.6.39 can handle Greg KH
2011-08-01 23:19 ` Greg KH [this message]
2011-08-01 23:19 ` [70/70] gro: Only reset frag0 when skb can be pulled Greg KH

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=20110801232057.540698730@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®