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: [004/102] bridge: send proper message_age in config BPDU
Date: Wed, 03 Aug 2011 15:00:24 -0700	[thread overview]
Message-ID: <20110803221244.490352893@clark.kroah.org> (raw)
In-Reply-To: <20110803221345.GA10346@kroah.com>

3.0-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
@@ -124,6 +124,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-03 23:45 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 22:13 [000/102] 3.0.1-stable review Greg KH
2011-08-03 22:00 ` [001/102] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-03 22:00 ` [002/102] mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency Greg KH
2011-08-03 22:00 ` [003/102] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get cleared Greg KH
2011-08-03 22:00 ` Greg KH [this message]
2011-08-03 22:00 ` [005/102] gro: Only reset frag0 when skb can be pulled Greg KH
2011-08-03 22:00 ` [006/102] Staging: usbip: vhci-hcd: Do not kill already dead RX/TX kthread Greg KH
2011-08-03 22:00 ` [007/102] staging: r8192e_pci: Handle duplicate PCI ID 0x10ec:0x8192 conflict with rtl8192se Greg KH
2011-08-03 22:00 ` [008/102] staging: comedi: fix infoleak to userspace Greg KH
2011-08-03 22:00 ` [009/102] Staging: hv: storvsc: Increase the timeout value in the storvsc driver Greg KH
2011-08-03 22:00 ` [010/102] Staging: hv: vmbus: Increase the timeout value in the vmbus driver Greg KH
2011-08-03 22:00 ` [011/102] Staging: hv: netvsc: Increase the timeout value in the netvsc driver Greg KH
2011-08-03 22:00 ` [012/102] USB: OHCI: fix another regression for NVIDIA controllers Greg KH
2011-08-03 22:00 ` [013/102] USB: EHCI: go back to using the system clock for QH unlinks Greg KH
2011-08-03 22:00 ` [014/102] usb: musb: restore INDEX register in resume path Greg KH
2011-08-03 22:00 ` [015/102] rtc: handle errors correctly in rtc_irq_set_state() Greg KH
2011-08-03 22:00 ` [016/102] rtc: fix hrtimer deadlock Greg KH
2011-08-03 22:00 ` [017/102] rtc: limit frequency Greg KH
2011-08-03 22:00 ` [018/102] drivers/rtc/rtc-tegra.c: properly initialize spinlock Greg KH
2011-08-03 22:00 ` [019/102] ARM: pxa/cm-x300: fix V3020 RTC functionality Greg KH
2011-08-03 22:00 ` [020/102] ASoC: davinci: add missing break statement Greg KH
2011-08-03 22:00 ` [021/102] ASoC: davinci: fix codec start and stop functions Greg KH
2011-08-03 22:00 ` [022/102] ASoC: Mark cache as dirty when suspending Greg KH
2011-08-03 22:00 ` [023/102] ath6kl: cache firmware Greg KH
2011-08-03 22:00 ` [024/102] ath6kl: fix crash when interface is closed but scan is ongoing Greg KH
2011-08-03 22:00 ` [025/102] ath9k_hw: Fix incorrect key_miss handling Greg KH
2011-08-03 22:00 ` [026/102] CIFS: Fix oops while mounting with prefixpath Greg KH
2011-08-03 22:00 ` [027/102] staging: brcm80211: fix for reported log spam problem Greg KH
2011-08-03 22:00 ` [028/102] jme: Fix unmap error (Causing system freeze) Greg KH
2011-08-03 22:00 ` [029/102] ethtool: Allow zero-length register dumps again Greg KH
2011-08-03 22:00 ` [030/102] firewire: cdev: return -ENOTTY for unimplemented ioctls, not -EINVAL Greg KH
2011-08-03 22:00 ` [031/102] firewire: cdev: prevent race between first get_info ioctl and bus reset event queuing Greg KH
2011-08-03 22:00 ` [032/102] IB/srp: Avoid duplicate devices from LUN scan Greg KH
2011-08-03 22:00 ` [033/102] [SCSI] libsas: remove expander from dev list on error Greg KH
2011-08-03 22:00 ` [034/102] rtlwifi: rtl8192cu: Fix duplicate if test Greg KH
2011-08-03 22:00 ` [035/102] mac80211: Restart STA timers only on associated state Greg KH
2011-08-03 22:00 ` [036/102] irq_work, ppc: Fix up arch hooks Greg KH
2011-08-03 22:00 ` [037/102] perf tools, x86: Fix 32-bit compile on 64-bit system Greg KH
2011-08-03 22:00 ` [038/102] perf tools: Fix endian conversion reading event attr from file header Greg KH
2011-08-03 22:00 ` [039/102] x86, intel, power: Initialize MSR_IA32_ENERGY_PERF_BIAS Greg KH
2011-08-03 22:01 ` [040/102] perf: Fix software event overflow Greg KH
2011-08-03 22:01 ` [041/102] [SCSI] Blacklist Traxdata CDR4120 and IOMEGA Zip drive to avoid lock ups Greg KH
2011-08-03 22:01 ` [042/102] [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise Greg KH
2011-08-03 22:01 ` [043/102] [SCSI] ses: requesting a fault indication Greg KH
2011-08-03 22:01 ` [044/102] [SCSI] fix crash in scsi_dispatch_cmd() Greg KH
2011-08-03 22:01 ` [045/102] [SCSI] pmcraid: reject negative request size Greg KH
2011-08-03 22:01 ` [046/102] [SCSI] hpsa: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [047/102] drm/radeon/kms: fix i2c map for rv250/280 Greg KH
2011-08-03 22:01 ` [048/102] drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 Greg KH
2011-08-03 22:01 ` [049/102] drm/radeon/kms: add missing vddci setting on NI+ Greg KH
2011-08-03 22:01 ` [050/102] ALSA: virtuoso: fix silent analog output on Xonar Essence ST Deluxe Greg KH
2011-08-03 22:01 ` [051/102] ALSA: hda - Fix duplicated DAC assignments for Realtek Greg KH
2011-08-03 22:01 ` [052/102] pnfs: save layoutcommit lwb at layout header Greg KH
2011-08-03 22:01 ` [053/102] pnfs: save layoutcommit cred at layout header init Greg KH
2011-08-03 22:01 ` [054/102] pnfs: let layoutcommit handle a list of lseg Greg KH
2011-08-03 22:01 ` [055/102] pnfs: use lwb as layoutcommit length Greg KH
2011-08-03 22:01 ` [056/102] kexec, x86: Fix incorrect jump back address if not preserving context Greg KH
2011-08-03 22:01 ` [057/102] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
2011-08-03 22:01 ` [058/102] powerpc/kdump: Fix timeout in crash_kexec_wait_realmode Greg KH
2011-08-03 22:01 ` [059/102] irq_work, alpha: Fix up arch hooks Greg KH
2011-08-03 22:01 ` [060/102] tracing: Fix bug when reading system filters on module removal Greg KH
2011-08-03 22:01 ` [061/102] tracing: Have "enable" file use refcounts like the "filter" file Greg KH
2011-08-03 22:01 ` [062/102] XZ: Fix missing <linux/kernel.h> include Greg KH
2011-08-03 22:01 ` [063/102] PCI: ARI is a PCIe v2 feature Greg KH
2011-08-03 22:01 ` [064/102] cciss: do not attempt to read from a write-only register Greg KH
2011-08-03 22:01 ` [065/102] drivers/firmware/sigma.c needs MODULE_LICENSE Greg KH
2011-08-03 22:01 ` [066/102] geode: reflect mfgpt dependency on mfd Greg KH
2011-08-03 22:01 ` [067/102] mm/futex: fix futex writes on archs with SW tracking of dirty & young Greg KH
2011-08-03 22:01 ` [068/102] mm/backing-dev.c: reset bdi min_ratio in bdi_unregister() Greg KH
2011-08-03 22:01 ` [069/102] xtensa: prevent arbitrary read in ptrace Greg KH
2011-08-03 22:01 ` [070/102] ext4: fix i_blocks/quota accounting when extent insertion fails Greg KH
2011-08-03 22:01 ` [071/102] ext4: free allocated and pre-allocated blocks when check_eofblocks_fl fails Greg KH
2011-08-03 22:01 ` [072/102] ext3: Fix oops in ext3_try_to_allocate_with_rsv() Greg KH
2011-08-03 22:01 ` [073/102] ecryptfs: Make inode bdi consistent with superblock bdi Greg KH
2011-08-03 22:01 ` [074/102] eCryptfs: Unlock keys needed by ecryptfsd Greg KH
2011-08-03 22:01 ` [075/102] nfsd: dont break lease on CLAIM_DELEGATE_CUR Greg KH
2011-08-03 22:01 ` [076/102] nfsd4: remember to put RW access on stateid destruction Greg KH
2011-08-03 22:01 ` [077/102] nfsd4: fix file leak on open_downgrade Greg KH
2011-08-03 22:01 ` [078/102] svcrpc: fix list-corrupting race on nfsd shutdown Greg KH
2011-08-03 22:01 ` [079/102] NFSv4: Dont use the delegation->inode in nfs_mark_return_delegation() Greg KH
2011-08-03 22:01 ` [080/102] NFS: Fix spurious readdir cookie loop messages Greg KH
2011-08-03 22:01 ` [081/102] proc: fix a race in do_io_accounting() Greg KH
2011-08-03 22:01 ` [082/102] n_gsm: fix the wrong FCS handling Greg KH
2011-08-03 22:01 ` [083/102] EHCI: only power off port if over-current is active Greg KH
2011-08-03 22:01 ` [084/102] EHCI: fix direction handling for interrupt data toggles Greg KH
2011-08-03 22:01 ` [085/102] cfg80211: really ignore the regulatory request Greg KH
2011-08-03 22:01 ` [086/102] memcg: fix behavior of mem_cgroup_resize_limit() Greg KH
2011-08-03 22:01 ` [087/102] tty/serial: Fix XSCALE serial ports, e.g. ce4100 Greg KH
2011-08-03 22:01 ` [088/102] SERIAL: SC26xx: Fix link error Greg KH
2011-08-03 22:01 ` [089/102] powerpc/pseries/hvconsole: Fix dropped console output Greg KH
2011-08-03 22:01 ` [090/102] hvc_console: Improve tty/console put_chars handling Greg KH
2011-08-03 22:01 ` [091/102] ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID Greg KH
2011-08-03 22:01 ` [092/102] AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock Greg KH
2011-08-03 22:01 ` [093/102] AppArmor: Fix masking of capabilities in complain mode Greg KH
2011-08-03 22:01 ` [094/102] oom: task->mm == NULL doesnt mean the memory was freed Greg KH
2011-08-03 22:01 ` [095/102] rt2x00: Add device ID for RT539F device Greg KH
2011-08-03 22:01 ` [096/102] GFS2: Fix mount hang caused by certain access pattern to sysfs files Greg KH
2011-08-03 22:01 ` [097/102] watchdog: shwdt: fix usage of mod_timer Greg KH
2011-08-03 22:01 ` [098/102] ALSA: sound/core/pcm_compat.c: adjust array index Greg KH
2011-08-03 22:01 ` [099/102] dm io: flush cpu cache with vmapped io Greg KH
2011-08-03 22:02 ` [100/102] dm snapshot: flush disk cache when merging Greg KH
2011-08-03 22:02 ` [101/102] dm mpath: fix potential NULL pointer in feature arg processing Greg KH
2011-08-03 22:02 ` [102/102] dm: fix idr leak on module removal 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=20110803221244.490352893@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®