aboutsummaryrefslogtreecommitdiff
path: root/sys/net/bridge.c
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace change - replace leading spaces with tabs.Luigi Rizzo2001-11-241-6/+6
| | | | Notes: svn path=/head/; revision=86843
* MFS: sync the ipfw/dummynet/bridge code with the one recently mergedLuigi Rizzo2001-11-041-88/+173
| | | | | | | into stable (mostly , but not only, formatting and comments changes). Notes: svn path=/head/; revision=86047
* Remove an extra splimp() call.Luigi Rizzo2001-11-011-1/+0
| | | | | | | Spotted-by: diff(1) Notes: svn path=/head/; revision=85812
* Fix this so it compiles cleanly for alpha. Tried to do some minimal testing.Matt Jacob2001-10-191-8/+8
| | | | | | | Reviewed by: freebsd-net Notes: svn path=/head/; revision=85181
* Traverse the list of network interfaces rather than use if_index- if_index isMatt Jacob2001-10-121-3/+1
| | | | | | | not guaranteed to be dense with respect to the actual list of interfaces. Notes: svn path=/head/; revision=84853
* Make it so dummynet and bridge can be loaded as modules.Paul Saab2001-10-051-27/+55
| | | | | | | Submitted by: billf Notes: svn path=/head/; revision=84516
* Two main changes here:Luigi Rizzo2001-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 Notes: svn path=/head/; revision=84058
* Remove unused variablePeter Wemm2001-06-151-1/+0
| | | | Notes: svn path=/head/; revision=78248
* Sync with the bridge/dummynet/ipfw code already tested in stable.Luigi Rizzo2001-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. Notes: svn path=/head/; revision=72270
* Mechanical change to use <sys/queue.h> macro API instead ofPoul-Henning Kamp2001-02-041-2/+2
| | | | | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1) Notes: svn path=/head/; revision=71999
* Use <sys/queue.h> macro api rather than fondle its implementation detals.Poul-Henning Kamp2001-02-031-6/+6
| | | | | | | | Created with: /usr/bin/sed Reviewed by: /sbin/md5 Notes: svn path=/head/; revision=71959
* MFS: bridge/ipfw/dummynet fixesLuigi Rizzo2001-02-021-170/+115
| | | | Notes: svn path=/head/; revision=71910
* Minor cleanups after yesterday's patch.Luigi Rizzo2001-01-261-19/+10
| | | | | | | The code (bridging and dummynet) actually worked fine! Notes: svn path=/head/; revision=71686
* Bring bridging code in line with the one which works on -STABLE.Luigi Rizzo2001-01-261-49/+97
| | | | | | | It compiles on -CURRENT, but I can not test functionality yet. Notes: svn path=/head/; revision=71666
* Assorted bugfixes:Luigi Rizzo2001-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. Notes: svn path=/head/; revision=71392
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Lock down the network interface queues. The queue mutex must be obtainedJonathan Lemon2000-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. Notes: svn path=/head/; revision=69152
* Fixup (hopefully) bridging + ipfw + dummynet together...Bosko Milekic2000-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 Notes: svn path=/head/; revision=69099
* In theory, m_dup should not be necessary, as m_copypacket should beNick Sayer2000-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 Notes: svn path=/head/; revision=66359
* Get rid of a panic that occurs in ether_demux() by dereferencing a NULL mbufBosko Milekic2000-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 Notes: svn path=/head/; revision=66316
* Follow BSD/OS and NetBSD, keep the ip_id field in network order all the time.Ruslan Ermilov2000-09-141-2/+0
| | | | | | | Requested by: wollman Notes: svn path=/head/; revision=65837
* Make the bridge_refresh operation automatic when ethernet interfacesNick Sayer2000-07-291-1/+6
| | | | | | | are attached or detached. Notes: svn path=/head/; revision=63992
* Oops. SYSCTL_HANDLER_ARGS -> (SYSCTL_HANDLER_ARGS)Nick Sayer2000-07-201-1/+1
| | | | Notes: svn path=/head/; revision=63679
* Add sysctl to perform bridge refresh. This is required if bridgedNick Sayer2000-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> Notes: svn path=/head/; revision=63672
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.Poul-Henning Kamp2000-07-041-2/+2
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=62573
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:Poul-Henning Kamp2000-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) Notes: svn path=/head/; revision=62454
* Don't try to apply ipfw filtering to non-IP packets.Archie Cobbs2000-06-021-0/+2
| | | | | | | Reported-by: "Lachlan O'Dea" <lodea@vet.com.au> Notes: svn path=/head/; revision=61192
* Move code to handle BPF and bridging for incoming Ethernet packets outArchie Cobbs2000-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 Notes: svn path=/head/; revision=60536
* Update bridging code to the one already in -stable (this wasLuigi Rizzo2000-02-081-185/+368
| | | | | | | | | forgotten some time ago...). Approved-by: jordan Notes: svn path=/head/; revision=57052
* IPSEC support in the kernel.Yoshinobu Inoue1999-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 Notes: svn path=/head/; revision=55009
* Fix kernel compile with BRIDGE, but without DUMMYNETNick Sayer1999-09-111-0/+3
| | | | Notes: svn path=/head/; revision=51172
* Fix two easy warnings when using BRIDGE without IPFIREWALL.Peter Wemm1999-07-011-2/+3
| | | | Notes: svn path=/head/; revision=48400
* Free the dummynet descriptor in ip_dummynet, not in the calledLuigi Rizzo1999-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 Notes: svn path=/head/; revision=46420
* Minor seatbelt tweak. The init code used to be splimp() protected,Peter Wemm1999-04-261-2/+7
| | | | | | | maintain that in case. Notes: svn path=/head/; revision=46090
* Fix my breakage of BRIDGE compiling option without IPFIREWALL..Peter Wemm1999-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) Notes: svn path=/head/; revision=45923
* Tidy up some stray / unused stuff in the IPFW package and friends.Peter Wemm1999-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 :-) Notes: svn path=/head/; revision=45869
* Add a missing declaration that broke the compilation of this file.John Polstra1999-04-031-0/+1
| | | | Notes: svn path=/head/; revision=45272
* Merge from RELENG_2_2, per luigi. Fixes the ntoh?() issue for theNick Sayer1999-03-301-3/+30
| | | | | | | | | | | firewall code when called from the bridge code. PR: 10818 Submitted by: nsayer Obtained from: luigi Notes: svn path=/head/; revision=45164
* The fe driver supports bridging, so added it to lists.KATO Takenori1999-02-251-3/+3
| | | | Notes: svn path=/head/; revision=44254
* * Change sysctl from using linker_set to construct its tree using SLISTs.Doug Rabson1999-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) Notes: svn path=/head/; revision=44078
* Remove one unused variable.Luigi Rizzo1998-12-311-2/+1
| | | | Notes: svn path=/head/; revision=42195
* Bridging support. Wait for LINT to be updated before trying it.Luigi Rizzo1998-12-141-8/+12
| | | | Notes: svn path=/head/; revision=41792
* fix an mbuf leak when using ipfw to filger bridged packetsLuigi Rizzo1998-09-181-2/+5
| | | | | | | (from -stable, since this code is not yet active in -current) Notes: svn path=/head/; revision=39464
* Bring in files for bridging support.Luigi Rizzo1998-09-121-0/+611
Notes: svn path=/head/; revision=39120