summaryrefslogtreecommitdiff
path: root/sys/net/bridgestp.c
AgeCommit message (Collapse)Author
2015-11-07Don't try to be clever testing if a queue is full before callingMartin Pieuchot
if_enqueue(). As pointed by dlg@, IF_QFULL on works in the priq case. Prompted by a diff from uebayasi@ to export ifi_oqdrops, ok dlg@
2015-11-02Some of the bridge code is running in splsoftnet now, change theReyk Floeter
splassert() in bstp_notify_rtage() from IPL_NET to IPL_SOFTNET accordingly. OK mpi@
2015-09-29add sizes to some of the simpler free callsTheo de Raadt
ok mpi
2015-07-17Pass the correct argument to bstp_notify_rtage().Martin Pieuchot
Problem found and fix provided by Ryota Ozaki, thanks! ok deraadt@, yasuoka@
2015-07-15m_freem() can handle NULL, do not check for this condition beforehands.Theo de Raadt
ok stsp mpi
2015-06-30Rename if_output() into if_enqueue() to avoid confusion with commentsMartin Pieuchot
talking about (*ifp->if_output)(). ok claudio@, dlg@
2015-06-16Store a unique ID, an interface index, rather than a pointer to theMartin Pieuchot
receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
2015-05-15Introduce if_output(), a function do to the last steps before enqueuingMartin Pieuchot
a packet on the sending queue of an interface. Tested by many, thanks a lot! ok dlg@, claudio@
2015-05-12This file is only compiled when "pseudo-device bridge" is included inMartin Pieuchot
your kernel configuration, no need for a #if NBRIDGE > 0 dance.
2015-05-04Use ether_input() as default input packet handler and do the necessaryMartin Pieuchot
m_adj(9) to keep bridge(4) working while other pseudo-drivers are converted to if_input(). Tested by mxb <mxb AT alumni DOT chalmers DOT se>, thanks! ok henning@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2014-12-19unifdef INET in net code as a precursor to removing the pretend option.Ted Unangst
long live the one true internet. ok henning mikeb
2014-09-08remove uneeded route.h includesJonathan Gray
ok miod@ mpi@
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-04-19minus altq tentacles, plus missing IF_DROP here as wellHenning Brauer
2013-10-20remove irrelevant commentTheo de Raadt
2013-10-17The header file netinet/in_var.h included netinet6/in6_var.h. ThisAlexander Bluhm
created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
2013-06-20Revert previous and unbreak asr, the new include should be protected.Martin Pieuchot
Reported by naddy@
2013-06-20Allocate the various hook head descriptors as part of the ifnetMartin Pieuchot
structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
2012-10-05Point an interface directly to its bridgeport configuration, insteadCamiel Dobbelaar
of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
2012-09-20Don't filter spanning tree BPDUs. Either process, or forward them.Marco Pfatschbacher
Even though this violates IEEE 802.1D, we'd rather avoid bridging loops by not getting in the way of STP. OK henning, camield, reyk
2011-07-09sned BPDUs at prio 6, just like lacp and carp, ryan zinke mpfHenning Brauer
2010-11-20remove bs_list occurrences. fixes panic on destroy.Federico G. Schwindt
ok from the m guild: mikeb@ miod@ mpf@
2010-10-31Remove unused bstp_list and bstp_attach.Marco Pfatschbacher
OK blambert, claudio.
2010-10-28A function that only returns NULL should return void.Claudio Jeker
bstp_input() always consumes the packet so remove the mbuf handling dance around it.
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-08-07account spanning tree frames in if_obytes and if_omcasts.Damien Bergamini
ok henning@
2008-06-14Remove NBPFILTER conditional since we do not include "bpfilter.h" and theJoel Sing
<net/bpf.h> header is not required here. ok henning@
2008-06-13we used to use the lowest (so it is deterministic) mac address in theHenning Brauer
system for the bridge ID for stp. That worksfine unless you have two bridges in the system that talkto the same neighboring systems (switches), because the two bridges on the openbsd system would have the same ID. fix by only looking at interfaces part of the bridge and using the lowest mac address of these. works fine because stpcan only be enabled on IFT_ETHER interfaces so there is always at least one and we re-evaluate every time an interface is added or deleted from the bridge. diff was rotting in my tree for at least a year, I have no idea what triggered it really. ok reyk mk djm
2008-05-21Just clear the timeout since timeout_del() can cope withMichael Knudsen
unscheduled/already triggered timeouts. ok brad claudio
2008-05-07enable tx mitigation when putting packets on the wire by switching fromDavid Gwynne
calls to ifp->if_start to if_start(). these are the obviously right cases where we can do that, the less obvious ones may follow as theyre figured out. deraadt@ said to go for it
2007-11-26typos; ok jmc@Martynas Venckus
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
2007-10-30fix a typo, LIST_FOREACH(bp2, ... and then using bp instead of bp2Henning Brauer
inside that loop doesn't yield the expected results. from freebsd r1.37 Andrew Thompson <thompsa@freebsd.org>
2007-10-14'syncronize' -> 'synchronize'. From Diego Casati.Kenneth R Westerback
2007-09-15malloc sweep:Henning Brauer
-remove useless casts -MALLOC/FREE -> malloc/free -use M_ZERO where appropriate instead of seperate bzero feedback & ok krw, hshoexer
2007-02-15Set topology change propagation on all ports _except_ the caller.Reyk Floeter
From FreeBSD
2007-02-14Consistently spell FALLTHROUGH to appease lint.Jonathan Gray
ok kettenis@ cloder@ tom@ henning@
2006-12-11refer to the RSTP point to point option as "PTP" instead of "P2P".Reyk Floeter
P2P is commonly used in relation to peer to peer networks, PTP is used in various protocols for layer 2 point to point links (ie., full duplex ethernet links). note that the newly added brconfig commands [-]p2p and [-]autop2p will change to [-]ptp and [-]autoptp. suggested by Andrew Thompson (thompsa@freebsd.org)
2006-12-03Add Rapid Spanning Tree Protocol support (802.1d-2004) based on workReyk Floeter
by Andrew Thompson (thompsa@freebsd.org). The local changes include adoption to our bridge code, reduced stack usage and many other bits. If stp is enabled, RSTP will now be used by default. Thanks for help from Andrew. This code has been in snaps for while now, commit encouraged by deraadt@
2006-11-24never call an ioctl without process context! this diffs checks theReyk Floeter
ifp->if_link_state instead of calling the ifmedia ioctl. this is safe in timeouts without process context and allows to use bridge stp with usb ethernet devices now. figured out and tested by Stuart Henderson, closes pr 5304.
2006-03-07use the cu_bridge_id rather than the cu_rootid for the bridge address.Brad Smith
From: Onno Molenkamp via Andrew Thompson <thompsa at freebsd dot org> ok jason@
2006-03-04With the exception of two other small uncommited diffs this movesBrad Smith
the remainder of the network stack from splimp to splnet. ok miod@
2005-10-12no need to call mfree() since m is always NULL; from Andrey MatveevMarkus Friedl
2005-06-07oopsTheo de Raadt
2005-06-07avoid retarded C unsigned char -> signed integer promotion rules.Theo de Raadt
mac->ac_enaddr[2] << 24 resulted in sign extension smashing other stuff djast@cs.toronto.edu, ok mickey
2003-11-16convert __attribute__((__packed__)) to __packed so that parsers unawareAnil Madhavapeddy
of gcc extensions have more of a chance. ok mcbride@, no objections from millert@, deraadt@
2003-06-02nuke clause 3 & 4Jason Wright
2002-12-10check IFF_RUNNING early in bstp_transmit_tcn; from netbsd; ok jason@Markus Friedl
2002-12-09knfTheo de Raadt