summaryrefslogtreecommitdiffstats
path: root/sys/net/bridge.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Make it so dummynet and bridge can be loaded as modules.ps2001-10-051-27/+55
| | | | Submitted by: billf
* Two main changes here:luigi2001-09-271-2/+2
| | | | | | | | | | | | | | | + implement "limit" rules, which permit to limit the number of sessions between certain host pairs (according to masks). These are a special type of stateful rules, which might be of interest in some cases. See the ipfw manpage for details. + merge the list pointers and ipfw rule descriptors in the kernel, so the code is smaller, faster and more readable. This patch basically consists in replacing "foo->rule->bar" with "rule->bar" all over the place. I have been willing to do this for ages! MFC after: 1 week
* Remove unused variablepeter2001-06-151-1/+0
|
* Sync with the bridge/dummynet/ipfw code already tested in stable.luigi2001-02-101-67/+60
| | | | | In ip_fw.[ch] change a couple of variable and field names to avoid having types, variables and fields with the same name.
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-2/+2
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Use <sys/queue.h> macro api rather than fondle its implementation detals.phk2001-02-031-6/+6
| | | | | Created with: /usr/bin/sed Reviewed by: /sbin/md5
* MFS: bridge/ipfw/dummynet fixesluigi2001-02-021-170/+115
|
* Minor cleanups after yesterday's patch.luigi2001-01-261-19/+10
| | | | The code (bridging and dummynet) actually worked fine!
* Bring bridging code in line with the one which works on -STABLE.luigi2001-01-261-49/+97
| | | | It compiles on -CURRENT, but I can not test functionality yet.
* Assorted bugfixes:luigi2001-01-221-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | + configuration: make sure that the NUL at the end of the config string is properly detected and handled, and the stats passed up via sysctl properly reflect which interfaces do bridging. (The whole config support might make good use of some cleanup in the future). + fixed some bugs related to the corruption of multicast and broadcast packets: make sure that for those packets the entire IP + ethernet header is in the mbuf, not in a cluster, so that writes performed in that area by the upper layers do not affect us. + performance: when calling m_pullup, make room for the ethernet header as well, we are going to add it in right after. Also, change an m_dup back to m_copypacket. The former is not necessary anymore now, and it did not help, anyways. I will do a fast MFC because 95% of this patch is fixing bad bugs and i doubt anyone would test the fix in CURRENT. Plus the last two items mostly bring back some code which was already there in 4.0 times.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-14/+2
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Fixup (hopefully) bridging + ipfw + dummynet together...bmilekic2000-11-231-2/+16
| | | | | | | | | | | | | | | | | | * Some dummynet code incorrectly handled a malloc()-allocated pseudo-mbuf header structure, called "pkt," and could consequently pollute the mbuf free list if it was ever passed to m_freem(). The fix involved passing not pkt, but essentially pkt->m_next (which is a real mbuf) to the mbuf utility routines. * Also, for dummynet, in bdg_forward(), made the code copy the ethernet header back into the mbuf (prepended) because the dummynet code that follows expects it to be there but it is, unfortunately for dummynet, passed to bdg_forward as a seperate argument. PRs: kern/19551 ; misc/21534 ; kern/23010 Submitted by: Thomas Moestl <tmoestl@gmx.net> Reviewed by: bmilekic Approved by: luigi
* In theory, m_dup should not be necessary, as m_copypacket should bensayer2000-09-251-3/+3
| | | | | | | | | | | | sifficient. But somewhere (I believe in the UDP stuff), someone is overwriting an mbuf without calling m_pullup() first. This results in broad- and multi-cast traffic that is passed through the bridge getting corrupted. This should be backed out when there is some assurance that the upper layers (and I suppose all of the device drivers) are fixed. Suggested by: archie
* Get rid of a panic that occurs in ether_demux() by dereferencing a NULL mbufbmilekic2000-09-241-0/+3
| | | | | | | | | pointer, when bridging and bridge_ipfw are enabled, and when bdg_forward() happens to free the packet and make our pointer NULL. There may be more similar problems like this one with calls to bdg_forward(). PR: Related to kern/19551 Reviewed by: jlemon
* Follow BSD/OS and NetBSD, keep the ip_id field in network order all the time.ru2000-09-141-2/+0
| | | | Requested by: wollman
* Make the bridge_refresh operation automatic when ethernet interfacesnsayer2000-07-291-1/+6
| | | | are attached or detached.
* Oops. SYSCTL_HANDLER_ARGS -> (SYSCTL_HANDLER_ARGS)nsayer2000-07-201-1/+1
|
* Add sysctl to perform bridge refresh. This is required if bridgednsayer2000-07-201-7/+29
| | | | | | | | configurations include loadable interfaces. After loading new interface drivers, perform a 'sysctl -w net.link.ether.bridge_refresh=1' and the bridge code will reinitialize itself. Submitted by: <vsilyaev@mindspring.com>
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-2/+2
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-2/+2
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Don't try to apply ipfw filtering to non-IP packets.archie2000-06-021-0/+2
| | | | Reported-by: "Lachlan O'Dea" <lodea@vet.com.au>
* Move code to handle BPF and bridging for incoming Ethernet packets outarchie2000-05-141-35/+23
| | | | | | | | | | | | | | | of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code. The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers. The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists. Reviewed by: freebsd-net
* Update bridging code to the one already in -stable (this wasluigi2000-02-081-185/+368
| | | | | | forgotten some time ago...). Approved-by: jordan
* IPSEC support in the kernel.shin1999-12-221-1/+2
| | | | | | | | pr_input() routines prototype is also changed to support IPSEC and IPV6 chained protocol headers. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Fix kernel compile with BRIDGE, but without DUMMYNETnsayer1999-09-111-0/+3
|
* Fix two easy warnings when using BRIDGE without IPFIREWALL.peter1999-07-011-2/+3
|
* Free the dummynet descriptor in ip_dummynet, not in the calledluigi1999-05-041-3/+1
| | | | | | | routines. The descriptor contains parameters which could be used within those routines (eg. ip_output() ). On passing, add IPPROTO_PGM entry to netinet/in.h
* Minor seatbelt tweak. The init code used to be splimp() protected,peter1999-04-261-2/+7
| | | | maintain that in case.
* Fix my breakage of BRIDGE compiling option without IPFIREWALL..peter1999-04-211-1/+5
| | | | | (Note that if you have bridge compiled in and then kldload ipfw, bridge won't automatically use it - knowledge of ipfw/dummynet is compiled in)
* Tidy up some stray / unused stuff in the IPFW package and friends.peter1999-04-201-3/+1
| | | | | | | | - unifdef -DCOMPAT_IPFW (this was on by default already) - remove traces of in-kernel ip_nat package, it was never committed. - Make IPFW and DUMMYNET initialize themselves rather than depend on compiled-in hooks in ip_init(). This means they initialize the same way both in-kernel and as kld modules. (IPFW initializes now :-)
* Add a missing declaration that broke the compilation of this file.jdp1999-04-031-0/+1
|
* Merge from RELENG_2_2, per luigi. Fixes the ntoh?() issue for thensayer1999-03-301-3/+30
| | | | | | | | firewall code when called from the bridge code. PR: 10818 Submitted by: nsayer Obtained from: luigi
* The fe driver supports bridging, so added it to lists.kato1999-02-251-3/+3
|
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-0/+1
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Remove one unused variable.luigi1998-12-311-2/+1
|
* Bridging support. Wait for LINT to be updated before trying it.luigi1998-12-141-8/+12
|
* fix an mbuf leak when using ipfw to filger bridged packetsluigi1998-09-181-2/+5
| | | | (from -stable, since this code is not yet active in -current)
* Bring in files for bridging support.luigi1998-09-121-0/+611
OpenPOWER on IntegriCloud