people/ms/rstp.git
8 years agoMerge remote-tracking branch 'upstream/master' master
Michael Tremer [Wed, 6 Jul 2011 19:08:28 +0000 (21:08 +0200)] 
Merge remote-tracking branch 'upstream/master'

Conflicts:
bridge_track.c

8 years agoIgnore carrier state on bridge device
Stephen Hemminger [Mon, 4 Jul 2011 21:37:25 +0000 (14:37 -0700)] 
Ignore carrier state on bridge device

The carrier of bridge device reflects underlying devices in later
kernels. Therefor RSTP daemon should ignore carrier (IFF_RUNNING)
and only look at IFF_UP on bridge device.

8 years agoMake local functions static
Stephen Hemminger [Mon, 4 Jul 2011 21:14:36 +0000 (14:14 -0700)] 
Make local functions static

8 years agoRemove variable set and never used
Stephen Hemminger [Mon, 4 Jul 2011 21:13:53 +0000 (14:13 -0700)] 
Remove variable set and never used

8 years agobridge-stp: Fix variable name used to generate pid_file
Alexander Stein [Tue, 28 Jun 2011 15:19:15 +0000 (17:19 +0200)] 
bridge-stp: Fix variable name used to generate pid_file

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
8 years agoMerge remote-tracking branch 'upstream/master'
Michael Tremer [Wed, 25 May 2011 09:36:42 +0000 (11:36 +0200)] 
Merge remote-tracking branch 'upstream/master'

Conflicts:
Makefile
brmon.c

8 years agoFix monitoring code
Stephen Hemminger [Wed, 18 May 2011 23:26:51 +0000 (16:26 -0700)] 
Fix monitoring code

Ignore OPERSTATE since bridge doesn't report this correctly.
Ignore messages about our own state changes
Remove dead code.

8 years agoTurn off compiler strict aliasing
Stephen Hemminger [Wed, 18 May 2011 23:08:56 +0000 (16:08 -0700)] 
Turn off compiler strict aliasing

The code does things like ntohs(*(unsigned short*) b->message_age)
which break strict alias checking in gcc.

8 years agoRemove code for passing STP BPDU via netlink
Stephen Hemminger [Wed, 18 May 2011 22:48:59 +0000 (15:48 -0700)] 
Remove code for passing STP BPDU via netlink

EMC implemented a mechanism of passing BPDU via netlink
that was never accepted in upstream kernel.

8 years agoremove dead code
Stephen Hemminger [Wed, 18 May 2011 22:48:22 +0000 (15:48 -0700)] 
remove dead code

9 years agoFix null pointer dereference in bridge_bpdu_rcv
Alexander Yurchenko [Fri, 19 Feb 2010 09:26:34 +0000 (12:26 +0300)] 
Fix null pointer dereference in bridge_bpdu_rcv

Check that the interface on which bpdu was received is actually
a bridge port. It's possible to receive an STP packet on
a bridge interface itself if the bridge has STP disabled
and forwards STP traffic.

Signed-off-by: Alexander Yurchenko <a.yurchenko@scalaxy.ru>
9 years agoFix rstpctl usage
Alexander Yurchenko [Fri, 19 Feb 2010 10:27:16 +0000 (13:27 +0300)] 
Fix rstpctl usage

Add missing ``rstp'' command to the rstpctl arguments.

Signed-off-by: Alexander Yurchenko <a.yurchenko@scalaxy.ru>
10 years agofixes for 4.3.3 GCC warnings/errors
Denys Fedoryschenko [Wed, 1 Apr 2009 16:06:55 +0000 (09:06 -0700)] 
fixes for 4.3.3 GCC warnings/errors

After fetching current git code and compiling with gcc 4.3.3 got errors
related to Werror (2 functions was ignoring return value), and ulimits.h was
not declared, but INT_MAX used
Here is fix, so rstp compile fine with gcc 4.3.3

Signed-off-by: Denys Fedoryschenko <denys@visp.net.lb>
10 years agofixes for 4.3.3 GCC warnings/errors
Denys Fedoryschenko [Wed, 1 Apr 2009 16:06:55 +0000 (09:06 -0700)] 
fixes for 4.3.3 GCC warnings/errors

After fetching current git code and compiling with gcc 4.3.3 got errors
related to Werror (2 functions was ignoring return value), and ulimits.h was
not declared, but INT_MAX used
Here is fix, so rstp compile fine with gcc 4.3.3

Signed-off-by: Denys Fedoryschenko <denys@visp.net.lb>
10 years agoUpdate headers to 2.6.29
Stephen Hemminger [Wed, 1 Apr 2009 16:00:14 +0000 (09:00 -0700)] 
Update headers to 2.6.29

11 years agoRemove file "bridge" which was incorrectly included.
Srinivas Aji [Thu, 29 Nov 2007 20:45:23 +0000 (02:15 +0530)] 
Remove file "bridge" which was incorrectly included.

   The "bridge" script was incorrectly included into this tree and isn't
   needed here anyway. Remove it.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoRemove unused RSTPLIB and related files.
Srinivas Aji [Thu, 29 Nov 2007 20:43:45 +0000 (02:13 +0530)] 
Remove unused RSTPLIB and related files.

   Remove all the RSTPLIB files. They aren't used anymore.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoUse new RSTP library.
Srinivas Aji [Thu, 29 Nov 2007 20:34:32 +0000 (02:04 +0530)] 
Use new RSTP library.

   This is a somewhat big commit which replaces the use of RSTPLIB in the
   RSTP daemon by the new RSTP library. This makes the daemon much more
   compliant with the 802.1D-2004 standard. The control program, rstpctl,
   has been modified so its output closer to the output of brctl showstp.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoAdd in new RSTP implementation to replace RSTPLIB.
Srinivas Aji [Thu, 29 Nov 2007 19:58:09 +0000 (01:28 +0530)] 
Add in new RSTP implementation to replace RSTPLIB.

   We have a new implementation of RSTP, which is meant to implement the
   Spanning Tree Protocol in IEEE 802.1D-2004. This implementation is
   written as a library consisting of one .c file and one .h file.
   It is written from scratch directly from the 802.1D-2004 document.
   This commit adds the files rstp.h and rstp.c to the directory, in
   preparation for modifying other code to use this instead of rstplib.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoRemoved portion of brmon.c which received BPDUs through netlink.
Srinivas Aji [Thu, 29 Nov 2007 17:38:12 +0000 (23:08 +0530)] 
Removed portion of brmon.c which received BPDUs through netlink.

   At one time, BPDUs were being received through netlink using a kernel
   patch. We now receive and send BPDUs through PF_PACKET sockets, so this
   code is not needed anymore.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoPut in Ethernet and LLC headers ourselves while sending BPDUs
Srinivas Aji [Mon, 28 May 2007 18:39:43 +0000 (00:09 +0530)] 
Put in Ethernet and LLC headers ourselves while sending BPDUs

   Take BPDU contents from RSTPLIB but create the Ethernet and LLC
   headers ourselves. The packet send interface has been modified to
   take an iovec array so we can pass the headers and data to it without
   making copies into another flat buffer.
   RSTPLIB then doesn't even need to know the port MAC addresses if we
   add an interface to configure the bridge address.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoTrack and cache bridge and port MAC addresses.
Srinivas Aji [Mon, 28 May 2007 18:30:40 +0000 (00:00 +0530)] 
Track and cache bridge and port MAC addresses.

   Check for MAC address change when we get notifications.
   If we get a port notification and find that the port MAC address
   changed, we check if the bridge MAC address changed as well.
   This will be useful for modifying RSTPLIB to allow setting bridge
   address instead of trying to replicate the kernel bridge address
   computation.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoImprove and fix validation of received BPDUs.
Srinivas Aji [Mon, 28 May 2007 18:22:43 +0000 (23:52 +0530)] 
Improve and fix validation of received BPDUs.

   Validate ethernet and LLC headers: Check destination address, length,
   and SAP fields. Also fix length checks for Config and RST BPDUs.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
11 years agoChange notification processing to account for kernel changes
Srinivas Aji [Mon, 28 May 2007 18:14:43 +0000 (23:44 +0530)] 
Change notification processing to account for kernel changes

   We now always get NEWLINK and DELLINK notifications for bridge port
   additions and deletions. And DELLINK is only for port deletions.
   So we can always remove a bridge port on a DELLINK notification,
   and not make uncertain checks in fear of missing this.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
12 years agoRSTP testing - PATCH: Typo in libnetlink.c origin
Aji, Srinivas [Thu, 10 May 2007 23:38:48 +0000 (16:38 -0700)] 
RSTP testing - PATCH: Typo in libnetlink.c

 Typo in libnetlink.c

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agoRSTP testing - PATCH: BPDU length calculation
Aji, Srinivas [Thu, 10 May 2007 23:37:26 +0000 (16:37 -0700)] 
RSTP testing - PATCH: BPDU length calculation

   The bpdu_len sent to STP_OUT_tx_bpdu() excludes the ethernet and
   and LLC headers, though the bpdu pointer points to the start of the
   ethernet header. Given the types in rstplib/stp_bpdu.h, we need to
   be sending a packet with (base, len) given by
   (bpdu, bpdu_len + sizeof(MAC_HEADER_T) + sizeof(ETH_HEADER_T))
   MAC_HEADER_T is dest and source ethernet addresses and ETH_HEADER_T
   is the 802.2 part.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agoRSTP testing - PATCH: source MAC address of BPDU
Aji, Srinivas [Thu, 10 May 2007 23:35:41 +0000 (16:35 -0700)] 
RSTP testing - PATCH: source MAC address of BPDU

   BPDU's were being sent out with an all zero source ethernet
   address. These packets don't make it far in the receive path on
   another bridge since bridge_handle_frame() checks for valid source
   ethernet address and drops them if that isn't the case.

   I needed to undo a change I made in rstplib/transmit.c, where I was
   not setting source MAC address because the LLC layer was doing it.

   TODO: We get notified when a port MAC address changes, so we should
   cache it. Right now it uses SIOCGIFHWADDR each time (for each BPDU
   sent) using a cached name, which is not good.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agorstpd: working version
Stephen Hemminger [Wed, 25 Apr 2007 23:43:28 +0000 (16:43 -0700)] 
rstpd: working version

This is the first version that works with modifications to bridge
that are going into 2.6.22

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agoSimple usermode helper script
Stephen Hemminger [Thu, 22 Mar 2007 23:05:52 +0000 (16:05 -0700)] 
Simple usermode helper script

12 years agoInitialize packet socket
Stephen Hemminger [Thu, 22 Mar 2007 23:05:30 +0000 (16:05 -0700)] 
Initialize packet socket

12 years agoBuild brmon again
Stephen Hemminger [Thu, 22 Mar 2007 20:57:58 +0000 (13:57 -0700)] 
Build brmon again

Sorry, that code was needed.

12 years agoRevised packet SOCK_RAW code
Stephen Hemminger [Thu, 22 Mar 2007 20:54:41 +0000 (13:54 -0700)] 
Revised packet SOCK_RAW code

Still not complete.

12 years agoremove ifdef'd code
Stephen Hemminger [Thu, 22 Mar 2007 20:42:37 +0000 (13:42 -0700)] 
remove ifdef'd code

The code is no longer needed.

12 years agonetlink shouldn't kill daemon
Stephen Hemminger [Thu, 22 Mar 2007 20:41:40 +0000 (13:41 -0700)] 
netlink shouldn't kill daemon

A netlink error shouldn't cause silent death of daemon.
It doesn't work well if library calls exit().

12 years agoConvert to using AF_PACKET for send and receive
Stephen Hemminger [Thu, 22 Mar 2007 00:35:50 +0000 (17:35 -0700)] 
Convert to using AF_PACKET for send and receive

Use AF_PACKET to send and receive spanning tree bpdu's
UNTESTED at this point.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agoreindent source
Stephen Hemminger [Wed, 21 Mar 2007 23:31:39 +0000 (16:31 -0700)] 
reindent source

Use kernel indentation style. Existing style was too odd.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
12 years agoupdate ignore file
Stephen Hemminger [Wed, 21 Mar 2007 23:26:38 +0000 (16:26 -0700)] 
update ignore file

12 years agofix build
Stephen Hemminger [Wed, 21 Mar 2007 23:25:04 +0000 (16:25 -0700)] 
fix build

12 years agoInitial commit
Stephen Hemminger [Wed, 21 Mar 2007 23:23:46 +0000 (16:23 -0700)] 
Initial commit

sources from  Aji_Srinivas@emc.com