summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* When pfil(9) is enabled the bridge only considers ETHERTYPE_ARP, ↵thompsa2005-12-291-5/+13
| | | | | | | | | | ETHERTYPE_IP and ETHERTYPE_IPV6 frames. Change this to be a sysctl knob so that is able to still bridge non-IP packets if desired. Also return early if all pfil_* sysctls are turned off, the user obviously does not want to filter on the bridge.
* add a sysctl to turn debug msgs on/off when built with IFMEDIA_DEBUGsam2005-12-251-0/+4
|
* 1) remove useless check of loop_copy - corresponding code was removed inoleg2005-12-221-5/+5
| | | | | | | | rev. 1.70 five years ago. 2) convert loop_copy to "non-negative" flag Approved by: glebius (mentor) MFC after: 2 weeks
* Add RFC 3378 EtherIP support. This change makes it possible to add gifthompsa2005-12-213-10/+95
| | | | | | | | interfaces to bridges, which will then send and receive IP protocol 97 packets. Packets are Ethernet frames with an EtherIP header prepended. Obtained from: NetBSD MFC after: 2 weeks
* As of r1.21 all broadcast packets are reprocessed by ether_input as arriving onthompsa2005-12-211-2/+6
| | | | | | | the bridge, this caused these packets to show up twice via bpf. Do not process them twice with BPF_TAP. MFC after: 3 days
* - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag inglebius2005-12-181-6/+7
| | | | | | | | | case if memory allocation failed. - Remove fourth argument from VLAN_INPUT_TAG(), that was used incorrectly in almost all drivers. Indicate failure with mbuf value of NULL. In collaboration with: yongari, ru, sam
* Use M_ZERO for the bridge_iflist to ensure there are no unexpected suprises.thompsa2005-12-171-1/+1
|
* Minor whitespace cleanup.thompsa2005-12-172-31/+31
|
* Change from a callback in if_ethersubr to using EVENTHANDLER in order to detachthompsa2005-12-173-21/+67
| | | | | | | span ports when they disappear. The span port does not have a pointer to the softc so revert r1.31 and bring back the softc linked-list. MFC after: 2 weeks
* It is not safe to use m_copypacket() here as the returned mbuf is readonly,thompsa2005-12-151-1/+6
| | | | | | change to m_dup and keep the alignment on the layer3 header. MFC after: 1 week
* Add support for creating span ports so that one can snoop bridged trafficthompsa2005-12-142-1/+152
| | | | | | | from another interface/machine/network. Obtained from: OpenBSD MFC after: 2 weeks
* Do not accept an empty bpf program.jkim2005-12-081-0/+3
|
* Add BPF Just-In-Time compiler support for ng_bpf(4).jkim2005-12-073-6/+8
| | | | | The sysctl is changed from net.bpf.jitter.enable to net.bpf_jitter.enable and this controls both bpf(4) and ng_bpf(4) now.
* s/M_WAITOK/M_NOWAIT/ while mutex is held.jkim2005-12-061-2/+2
| | | | Pointed out by: csjp
* Add experimental BPF Just-In-Time compiler for amd64 and i386.jkim2005-12-064-3/+222
| | | | | | | | | | | | | | | | | Use the following kernel configuration option to enable: options BPF_JITTER If you want to use bpf_filter() instead (e. g., debugging), do: sysctl net.bpf.jitter.enable=0 to turn it off. Currently BIOCSETWF and bpf_mtap2() are unsupported, and bpf_mtap() is partially supported because 1) no need, 2) avoid expensive m_copydata(9). Obtained from: WinPcap 3.1 (for i386)
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-041-1/+1
|
* Fix -Wundef.ru2005-12-041-4/+4
|
* The bridge is capable of sending broadcast packets so enable IFF_BROADCASTthompsa2005-11-291-1/+1
| | | | Requested by: des
* Take if_baudrate from the parent. This fixes problem with SNMPglebius2005-11-281-0/+1
| | | | daemons reporting zero speed for vlan(4) interfaces.
* Fix the following bugs:ru2005-11-241-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In ifc_name2unit(), disallow leading zeroes in a unit. Exploit: ifconfig lo01 create - In ifc_name2unit(), properly handle overflows. Otherwise, either of two local panic()'s can occur, either because no interface with such a name could be found after it was successfully created, or because the code will bogusly assume that it's a wildcard (unit < 0 due to overflow). Exploit: ifconfig lo<overflowed_integer> create - Previous revision made the following sequence trigger a KASSERT() failure in queue(3): Exploit: ifconfig lo0 destroy; ifconfig lo0 destroy This is because IFC_IFLIST_REMOVE() is always called before ifc->ifc_destroy() has been run, not accounting for the fact that the latter can fail and leave the interface operating (like is the case for "lo0"). So we ended up calling LIST_REMOVE() twice. We cannot defer IFC_IFLIST_REMOVE() until after a call to ifc->ifc_destroy() because the ifnet may have been removed and its memory has been freed, so recover from this by re-inserting the ifnet in the cloned interfaces list if ifc->ifc_destroy() indicates a failure.
* Purge layer specific mbuf flags on layer crossings to avoid confusingandre2005-11-181-0/+3
| | | | | | upper or lower layers. Sponsored by: TCP/IP Optimization Fundraise 2005
* Fix a second missed case where the refcount is not decremented.thompsa2005-11-131-2/+3
| | | | MFC after: 3 days
* Fix a mbuf and refcnt leak in the broadcast code.thompsa2005-11-131-4/+4
| | | | | | | If the packet is rejected from pfil(9) then continue the loop rather than returning, this means that we can still try to send it out the remaining interfaces but more importantly the mbuf is freed and refcount decremented on exit.
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-1114-65/+46
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Use the more appropriate ifnet_byindex() instead of ifaddr_byindex().ru2005-11-111-2/+2
|
* Force this interface to be RUNNING.glebius2005-11-111-0/+1
|
* - Make IFP2ENADDR() a pointer to IF_LLADDR() rather than anotherru2005-11-118-44/+18
| | | | | | | | copy of Ethernet address. - Change iso88025_ifattach() and fddi_ifattach() to accept MAC address as an argument, similar to ether_ifattach(), to make this work.
* Use sparse initializers for "struct domain" and "struct protosw",ru2005-11-093-26/+43
| | | | so they are easier to follow for the human being.
* Move the cloned interface list management in to if_clone. For some drivers thethompsa2005-11-0812-125/+63
| | | | | | | | | | softc lists and associated mutex are now unused so these have been removed. Calling if_clone_detach() will now destroy all the cloned interfaces for the driver and in most cases is all thats needed to unload. Idea by: brooks Reviewed by: brooks
* - Do not raise IFF_DRV_OACTIVE flag in vlan_start, because thisglebius2005-11-061-2/+8
| | | | | | | can lead to stalled interface - Explain this fact in a comment. Reviewed by: rwatson, thompsa, yar
* Retire MT_HEADER mbuf type and change its users to use MT_DATA.andre2005-11-021-1/+1
| | | | | | | | | | | | Having an additional MT_HEADER mbuf type is superfluous and redundant as nothing depends on it. It only adds a layer of confusion. The distinction between header mbuf's and data mbuf's is solely done through the m->m_flags M_PKTHDR flag. Non-native code is not changed in this commit. For compatibility MT_HEADER is mapped to MT_DATA. Sponsored by: TCP/IP Optimization Fundraise 2005
* If we have been called from ether_ifdetach() then do not try and clear thethompsa2005-10-231-20/+25
| | | | | | | | | promisc flag from the member interface, this is a no-op anyway since the interface is disappearing. The driver may have already released its resources such as miibus and this is likely to panic the kernel. Submitted and tested by: Wojciech A. Koszek MFC after: 2 weeks
* Before we export network interface data through the ifmibdata structure,csjp2005-10-231-1/+1
| | | | | | OR the flags bits with the driver managed status flags. This fixes an issue where RUNNING flags would not be reported to processes, which conflicts with the flags information provided by ifconfig(8).
* Use new (inline) functions for calls into driver.phk2005-10-162-7/+5
|
* Make four more functions static that were missed in the last commit.thompsa2005-10-141-5/+5
|
* Change most of the bridge and stp funtions to static. This has highlightedthompsa2005-10-142-209/+226
| | | | | | | | | | | that the following funtions are not used, wrap in '#ifdef noused' for the moment. bstp_enable_change_detection bstp_disable_change_detection bstp_set_bridge_priority bstp_set_port_priority bstp_set_path_cost
* Further clean up the bridge hooks in if_ethersubr.c and ng_ether.cthompsa2005-10-144-31/+33
| | | | | | - move the function pointer definitions to if_bridgevar.h - move most of the logic to the new BRIDGE_INPUT and BRIDGE_OUTPUT macros - remove unneeded functions from if_bridgevar.h and sort a little.
* From 101 ways to panic your kernel.thompsa2005-10-132-1/+13
| | | | | | Use bridge_ifdetach() to notify the bridge that a member has been detached. The bridge can then remove it from its interface list and not try to send out via a dead pointer.
* Consolidate two adjacent conditional blocksjulian2005-10-131-5/+1
| | | | | | | I actually believe the code in question should be elsewhere (in the preceding function). MFC after: 1 week
* Remove a stale comment.ru2005-10-131-1/+0
|
* Clean up the if_bridge hooks a bit in if_ethersubr.c and ng_ether.c, movethompsa2005-10-132-14/+10
| | | | | | the broadcast/multicast test to bridge_input(). Requested by: glebius
* Change the reference counting to count the number of cloned interfaces for eachthompsa2005-10-128-101/+61
| | | | | | | | | | | | | | | cloner. This ensures that ifc->ifc_units is not prematurely freed in if_clone_detach() before the clones are destroyed, resulting in memory modified after free. This could be triggered with if_vlan. Assert that all cloners have been destroyed when freeing the memory. Change all simple cloners to destroy their clones with ifc_simple_destroy() on module unload so the reference count is properly updated. This also cleans up the interface destroy routines and allows future optimisation. Discussed with: brooks, pjd, -current Reviewed by: brooks
* Be pedantic here: We're converting from network byte order to hostimp2005-10-121-2/+2
| | | | | | | byte order in these cases. This is a nop in terms of the generated code, but is logically incorrect. PR: 73852
* Do not unconditionally set a spanning tree port to forwarding as the link may bethompsa2005-10-111-1/+1
| | | | | | down when we attach. We wont get updated until a linkstate change happens. Go via bstp_ifupdstatus() which checks the media status first.
* A deja vu of:glebius2005-10-071-1/+4
| | | | | | | | | | | | | | http://lists.freebsd.org/pipermail/cvs-src/2004-October/033496.html The same problem applies to if_bridge(4), too. - Copy-and-paste the if_bridge(4) related block from if_ethersubr.c to ng_ether.c - Add XXXs, so that copy-and-paste would be noticed by any future editors of this code. - Also add XXXs near if_bridge(4) declarations. Silence from: thompsa
* Fixing a boot time panic(when if_fwip is compiled into kernel) by renamingavatar2005-10-061-3/+3
| | | | | | | | | module name to something that wouldn't conflict with sys/dev/firewire/firewire.c. Submitted by: Cai, Quanqing <caiquanqing at gmail dot com> PR: kern/82727 MFC after: 3 days
* Fix KASSERT function name in ether_output, use __func__ while I am here.thompsa2005-10-061-2/+2
|
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceglebius2005-10-051-0/+1
| | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde
* Protect PID initializations for statistics by the bpf descriptorcsjp2005-10-041-2/+6
| | | | | | | locks. Also while we are here, protect the bpf descriptor during knlist_remove{add} operations. Discussed with: rwatson
* Rename net.isr.enable to net.isr.dispatch.rwatson2005-10-041-5/+5
| | | | | | | | No compatibility code is provided, as this will be the production name as of 6.0. MFC after: 3 days Requested by: scottl
OpenPOWER on IntegriCloud