14 Oct, 2013

2 commits

  • [ Upstream commit be4f154d5ef0ca147ab6bcd38857a774133f5450 ]

    At some point limits were added to forward_delay. However, the
    limits are only enforced when STP is enabled. This created a
    scenario where you could have a value outside the allowed range
    while STP is disabled, which then stuck around even after STP
    is enabled.

    This patch fixes this by clamping the value when we enable STP.

    I had to move the locking around a bit to ensure that there is
    no window where someone could insert a value outside the range
    while we're in the middle of enabling STP.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Herbert Xu
     
  • [ Upstream commit 9a0620133ccce9dd35c00a96405c8d80938c2cc0 ]

    This changes the message_age_timer calculation to use the BPDU's max age as
    opposed to the local bridge's max age. This is in accordance with section
    8.6.2.3.2 Step 2 of the 802.1D-1998 sprecification.

    With the current implementation, when running with very large bridge
    diameters, convergance will not always occur even if a root bridge is
    configured to have a longer max age.

    Tested successfully on bridge diameters of ~200.

    Signed-off-by: Chris Healy
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Chris Healy
     

01 May, 2013

1 commit

  • Bridge can crash while trying to send topology change packet.
    This happens if root port can't be found. This was reported by user
    but currently unable to reproduce it easily. The STP conditions that cause
    this are not known yet, but the problem doesn't have to be fatal.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

15 Nov, 2012

1 commit

  • This is Linux bridge implementation of root port guard.
    If BPDU is received from a leaf (edge) port, it should not
    be elected as root port.

    Why would you want to do this?
    If using STP on a bridge and the downstream bridges are not fully
    trusted; this prevents a hostile guest for rerouting traffic.

    Why not just use netfilter?
    Netfilter does not track of follow spanning tree decisions.
    It would be difficult and error prone to try and mirror STP
    resolution in netfilter module.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

16 Apr, 2012

1 commit


08 Mar, 2012

1 commit


05 Mar, 2012

2 commits


02 Dec, 2011

1 commit

  • When in user-stp mode, bridge master do not follow state of its slaves, so
    after the following sequence of events it can stuck forever in no-carrier
    state:
    1) turn stp off
    2) put all slaves down - master device will follow their state and also go in
    no-carrier state
    3) turn stp on with bridge-stp script returning 0 (go to the user-stp mode)
    Now bridge master won't follow slaves' state and will never reach running
    state.

    This patch solves the problem by making user-stp and kernel-stp behavior
    similar regarding master following slaves' states.

    Signed-off-by: Vitalii Demianets
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Vitalii Demianets
     

23 Jul, 2011

3 commits

  • Some minor cleanups that won't impact code:
    1. Remove inline from non-critical functions; compiler will most
    likely inline them anyway.
    2. Make function args const where possible.
    3. Whitespace cleanup

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • When STP changes state of interface need to send a new link
    message to reflect that change.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • 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
    Signed-off-by: David S. Miller

    stephen hemminger
     

05 Apr, 2011

1 commit

  • Apply restrictions on STP parameters based 802.1D 1998 standard.
    * Fixes missing locking in set path cost ioctl
    * Uses common code for both ioctl and sysfs

    This is based on an earlier patch Sasikanth V but with overhaul.

    Note:
    1. It does NOT enforce the restriction on the relationship max_age and
    forward delay or hello time because in existing implementation these are
    set as independant operations.

    2. If STP is disabled, there is no restriction on forward delay

    3. No restriction on holding time because users use Linux code to act
    as hub or be sticky.

    4. Although standard allow 0-255, Linux only allows 0-63 for port priority
    because more bits are reserved for port number.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

16 Mar, 2011

1 commit


15 Mar, 2011

2 commits

  • If Spanning Tree Protocol is not enabled, there is no good reason for
    the bridge code to wait for the forwarding delay period before enabling
    the link. The purpose of the forwarding delay is to allow STP to
    learn about other bridges before nominating itself.

    The only possible impact is that when starting up a new port
    the bridge may flood a packet now, where previously it might have
    seen traffic from the other host and preseeded the forwarding table.

    Includes change for local variable br already available in that func.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • This makes the bridge device behave like a physical device.
    In earlier releases the bridge always asserted carrier. This
    changes the behavior so that bridge device carrier is on only
    if one or more ports are in the forwarding state. This
    should help IPv6 autoconfiguration, DHCP, and routing daemons.

    I did brief testing with Network and Virt manager and they
    seem fine, but since this changes behavior of bridge, it should
    wait until net-next (2.6.39).

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Nicolas de Pesloüan
    Tested-By: Adam Majer
    Signed-off-by: David S. Miller

    stephen hemminger
     

16 May, 2010

1 commit


28 Feb, 2010

1 commit


06 Aug, 2009

1 commit


18 May, 2009

1 commit

  • If bridge is configured with no STP and forwarding delay of 0 (which
    is typical for virtualization) then when link starts it will flood all
    packets for the first 20 seconds.

    This bug was introduced by a combination of earlier changes:
    * forwarding database uses hold time of zero to indicate
    user wants to always flood packets
    * optimzation of the case of forwarding delay of 0 avoids the initial
    timer tick

    The fix is to just skip all the topology change detection code if
    kernel STP is not being used.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

06 Aug, 2008

1 commit

  • From: Stephen Hemminger

    Based upon original patch by Herbert Xu, which contained
    the following problem description:

    --------------------
    When the forward delay is set to zero, we still delay the setting
    of the forwarding state by one or possibly two timers depending
    on whether STP is enabled. This could either turn out to be
    instantaneous, or horribly slow depending on the load of the
    machine.

    As there is nothing preventing us from enabling forwarding straight
    away, this patch eliminates this potential delay by executing the
    code directly if the forward delay is zero.

    The effect of this problem is that immediately after the carrier
    comes on a port, the bridge will drop all packets received from
    that port until it enters forwarding mode, thus causing unnecessary
    packet loss.

    Note that this patch doesn't fully remove the delay due to the
    link watcher. We should also check the carrier state when we
    are about to drop an incoming packet because the port is disabled.
    But that's for another patch.
    --------------------

    This version of the fix takes a different approach, in that
    it just does the state change directly.

    Signed-off-by: David S. Miller

    Stephen Hemminger
     

18 Jul, 2008

1 commit


12 Jun, 2008

1 commit


19 May, 2008

1 commit

  • Move rcu-protected lists from list.h into a new header file rculist.h.

    This is done because list are a very used primitive structure all over the
    kernel and it's currently impossible to include other header files in this
    list.h without creating some circular dependencies.

    For example, list.h implements rcu-protected list and uses rcu_dereference()
    without including rcupdate.h. It actually compiles because users of
    rcu_dereference() are macros. Others RCU functions could be used too but
    aren't probably because of this.

    Therefore this patch creates rculist.h which includes rcupdates without to
    many changes/troubles.

    Signed-off-by: Franck Bui-Huu
    Acked-by: Paul E. McKenney
    Acked-by: Josh Triplett
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar

    Franck Bui-Huu
     

31 May, 2007

1 commit


09 May, 2007

1 commit


26 Apr, 2007

1 commit

  • This patchset based on work by Aji_Srinivas@emc.com provides allows
    spanning tree to be controled from userspace. Like hotplug, it
    uses call_usermodehelper when spanning tree is enabled so there
    is no visible API change. If call to start usermode STP fails
    it falls back to existing kernel STP.

    Signed-off-by: Stephen Hemminger

    Stephen Hemminger
     

11 Feb, 2007

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds