summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* accept short WEP keys for backward compatibilitysam2003-01-191-2/+1
|
* Originally when DEVFS was added, a global variable "devfs_present"phk2003-01-192-16/+18
| | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit.
* fix ioctl handling for setting wep keyssam2003-01-191-4/+6
|
* sync with KAME to simplify rev 1.28's patch (no functional changes)suz2003-01-151-24/+41
| | | | | | Obtained from: KAME Reviewd by: fenner Approved by: re (jhb)
* 802.11 link layer support. This code implements the basic 802.11sam2003-01-152-77/+3830
| | | | | | | | | | | state machine to provide station and host ap functionality for drivers. More work will follow to split out the state machine and protocol support from the ioctl interfaces to ease portability/sharing with NetBSD and forthcoming ports to other systems. Reviewed by: imp Obtained from: NetBSD (originally)
* don't reference a pkthdr after M_MOVE_PKTHDR has "remove it"; insteadsam2003-01-061-2/+2
| | | | | | reference the pkthdr now in the destination of the move Sponsored by: Vernier Networks
* Fix alignment problems -- the embedded v4 address is guaranteed tofenner2003-01-051-15/+17
| | | | be only 16-bit aligned, so only do byte operations to compare with it.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-012-3/+3
| | | | especially in troff files.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Correct mbuf packet header propagation. Previously, packet headerssam2002-12-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | were sometimes propagated using M_COPY_PKTHDR which actually did something between a "move" and a "copy" operation. This is replaced by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it from the source mbuf) and m_dup_pkthdr which copies the packet header contents including any m_tag chain. This corrects numerous problems whereby mbuf tags could be lost during packet manipulations. These changes also introduce arguments to m_tag_copy and m_tag_copy_chain to specify if the tag copy work should potentially block. This introduces an incompatibility with openbsd which we may want to revisit. Note that move/dup of packet headers does not handle target mbufs that have a cluster bound to them. We may want to support this; for now we watch for it with an assert. Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG. Supported by: Vernier Networks Reviewed by: Robert Watson <rwatson@FreeBSD.org>
* Remove cdevw_add() calls, they are deprecated.phk2002-12-281-1/+0
|
* Remove useless local variable from raw_input().kbyanc2002-12-281-3/+0
| | | | | Sponsored by: NTT Multimedia Communications Labs MFC after: 3 days
* Oops, I misread the purpose of the NULL check in EH_RESTORE() iniedowse2002-12-271-2/+3
| | | | | | | | revision 1.62. It was checking for M_PREPEND() failing, not for the case of a NULL mbuf pointer being supplied to the macro. Back out that revision, and fix the NULL dereference by not calling EH_RESTORE() in the case where the mbuf pointer is NULL because the firewall rejected the packet.
* Fix a bug introduced by revision 1.59 that would cause an immediateiedowse2002-12-271-1/+1
| | | | NULL dereference if a bridged packet was rejected by ipfw.
* Long chain of calls starting with bridge_on(), going through IPv6, andhsu2002-12-271-1/+2
| | | | | ending up at ifa_ifwithdstaddr() could lead to a recursive lock of the ifnet list mutex.
* Disable radix node locking for sysctl until we fix the sysctl infrastructurehsu2002-12-261-5/+5
| | | | to not sleep.
* Typo in function name.ru2002-12-251-4/+4
|
* I'm not sure what was the problem at the time of revision 1.37ru2002-12-251-11/+0
| | | | | | | | when julian@ added it, but the commented out code had at least one bug -- not freeing the allocated mbuf. Anyway, this comment no longer applies as of revision 1.67, so remove it.
* Range-check the address family parameter passed in to the sysctl handler.hsu2002-12-251-0/+2
| | | | Submitted by: ru
* Revision 1.67 changes correspond to CSRG revision 8.3.1.1 changes.ru2002-12-251-1/+1
|
* If the caller of rtrequest*(RTM_DELETE, ...) asked for a copy ofru2002-12-252-19/+6
| | | | | | the entry being removed (ret_nrt != NULL), increment the entry's rt_refcnt like we do it for RTM_ADD and RTM_RESOLVE, rather than messing around with 1->0 transitions for rtfree() all over.
* A month after pst@ has committed his revision 1.8, it wasru2002-12-251-3/+6
| | | | incorporated by UCB as revision 8.5. Do a diff reduction.
* SMP locking for radix nodes.hsu2002-12-245-17/+66
|
* rn_walktree*() compute the next leaf before applying a functionru2002-12-231-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to current leaves because function may vanish the current node. If parent RTA_GENMASK route has a clone (a "cloning clone"), an rn_walktree_from() starting from parent will cause another walk starting from clone. If a function is either rt_fixdelete() or rt_fixchange(), this recursive walk may vanish the leaf that is remembered by an outer walk (the "next leaf" above), panicing a system when it resumes with an outer walk. The following script paniced my single-user mode booted system: : sysctl net.inet.ip.forwarding=1 : ipfw add 1 allow ip from any to any : ifconfig lo0 127.1 : route add -net 10 -genmask 255.255.255.0 127.1 : telnet 10.1 # rt_fixchange() panic : telnet 10.2 : telnet 10.1 : route delete -net 10 # rt_fixdelete() panic For the time being, avoid these races by disallowing recursive walks in rt_fixchange() and rt_fixdelete(). Also, make a slight optimization in the rtrequest(RTM_RESOLVE) case: there is no reason to call rt_fixchange() in this case. PR: kern/37606 MFC after: 5 days
* SMP locking for ifnet list.hsu2002-12-225-13/+58
|
* Swap the order of a free and a use of an ifaddr structure.hsu2002-12-201-1/+1
|
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andbmilekic2002-12-196-11/+10
| | | | | | | | | | the mbuf allocator flags {M_TRYWAIT, M_DONTWAIT}. o Fix a bpf_compat issue where malloc() was defined to just call bpf_alloc() and pass the 'canwait' flag(s) along. It's been changed to call bpf_alloc() but pass the corresponding M_TRYWAIT or M_DONTWAIT flag (and only one of those two). Submitted by: Hiten Pandya <hiten@unixdaemons.com> (hiten->commit_count++)
* Under some circumstances, the loopback interface will allocate a newrwatson2002-12-181-0/+10
| | | | | | | | | | | | | | | | mbuf for a packet looping back to provide alignment guarantees for KAME. Unfortunately, this code performs a direct copy of the header rather than using a header copying primitive (largely because we have sucky header copying primitives). This results in a multiple free of the MAC label in the header when the same label data is freed twice when the two mbufs with that header are freed. As a temporary work-around, clear the initialized flag on the label to prevent the duplicate free, which prevents panics on large unaligned loopback IP and IPv6 data. The real fix is to improve and make use of proper packet header copying routines here. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Switch to the conventional reference counting scheme.hsu2002-12-181-15/+15
|
* Lock up ifaddr reference counts.hsu2002-12-185-40/+45
|
* MFS: recognize gre packets used in the WCCP protocol.sobomax2002-12-071-0/+7
| | | | Approved by: re
* Move fw_one_pass from ip_fw2.c to ip_input.c so that neitherluigi2002-11-201-1/+1
| | | | | | | | | bridge.c nor if_ethersubr.c depend on IPFIREWALL. Restore the use of fw_one_pass in if_ethersubr.c ipfw.8 will be updated with a separate commit. Approved by: re
* Back out some style changes. They are not urgent,luigi2002-11-202-21/+35
| | | | | | | I will put them back in after 5.0 is out. Requested by: sam Approved by: re
* correct function declarations of stubs used for building w/o device bpfsam2002-11-191-4/+4
|
* Replace m_copy() with m_copypacket() where applicable.luigi2002-11-171-24/+16
| | | | | Replace 0 with NULL where appropriate. Fix indentation and function headers.
* Fix function headers, remove 'register' from variable declarations.luigi2002-11-171-11/+5
|
* Massive cleanup of the ip_mroute code.luigi2002-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes, but: + the mrouting module now should behave the same as the compiled-in version (it did not before, some of the rsvp code was not loaded properly); + netinet/ip_mroute.c is now truly optional; + removed some redundant/unused code; + changed many instances of '0' to NULL and INADDR_ANY as appropriate; + removed several static variables to make the code more SMP-friendly; + fixed some minor bugs in the mrouting code (mostly, incorrect return values from functions). This commit is also a prerequisite to the addition of support for PIM, which i would like to put in before DP2 (it does not change any of the existing APIs, anyways). Note, in the process we found out that some device drivers fail to properly handle changes in IFF_ALLMULTI, leading to interesting behaviour when a multicast router is started. This bug is not corrected by this commit, and will be fixed with a separate commit. Detailed changes: -------------------- netinet/ip_mroute.c all the above. conf/files make ip_mroute.c optional net/route.c fix mrt_ioctl hook netinet/ip_input.c fix ip_mforward hook, move rsvp_input() here together with other rsvp code, and a couple of indentation fixes. netinet/ip_output.c fix ip_mforward and ip_mcast_src hooks netinet/ip_var.h rsvp function hooks netinet/raw_ip.c hooks for mrouting and rsvp functions, plus interface cleanup. netinet/ip_mroute.h remove an unused and optional field from a struct Most of the code is from Pavlin Radoslavov and the XORP project Reviewed by: sam MFC after: 1 week
* Back out rev 1.150; things are more complicated than this.sam2002-11-151-1/+1
|
* if_attach should not sleep; change malloc's M_WAITOK to M_NOWAITsam2002-11-151-1/+1
|
* network interface and link layer changes:sam2002-11-1516-78/+58
| | | | | | | | | | | | o on input don't strip the Ethernet header from packets o input packet handling is now done with if_input o track changes to ether_ifattach/ether_ifdetach API o track changes to bpf tapping o call ether_ioctl for default handling of ioctl's o use constants from net/ethernet.h where possible Reviewed by: many Approved by: re
* track changes to ethernet input handling to no longer strip the Ethernet headersam2002-11-141-48/+55
| | | | | Reviewed by: many Approved by: re
* o eliminate separate callback interface for h/w tagged input packets; insteadsam2002-11-142-164/+302
| | | | | | | | | | | | | | | | | | | | | drivers "tag packets" with an m_tag and the input packet handling recognizes such packets and does the right thing o track the number of active vlans on an interface; this lets lots of places only do vlan-specific processing when needed o track changes to ether_ifdetach/ether_ifattach o track bpf changes o eliminate the use of M_PROTO1 for communicating to drivers about tagged packets o eliminate the use of IFF_LINK0 for drivers communicating to the vlan code that they support h/w tagging; replaced by explicit interface capabilities o add ifnet capabilities for h/w tagging and support of "large mtu's" o use new interface capabilities to auto-configure use of large mtu's and h/w tagging o add support for proper handling of promiscuous mode o document driver/vlan communication conventions Reviewed by: many Approved by: re
* o add if_nvlans member to track the number of vlans active on an interfacesam2002-11-141-9/+3
| | | | | | | | o add if_input member for interface drivers to call through to pass packets "up" o remove ethernet-specific function decls (moved to ethernet.h) Reviewed by: many Approved by: re
* o change input packet handling to eliminate the pointer to the structsam2002-11-141-185/+263
| | | | | | | | | | | | | | | | | | | | | ether_header; instead drivers are to leave the Ethernet header at the front of the packet o add declarations for netgraph and vlan hooks that were removed from ethernet.h o change various in-file calling conventions to track change in input API o fixup bridge support to handle Ethernet header no longer being stripped o add consistency checks to ether_input to catch problems with the change in the API; some of these may want to be moved to #ifdef DIAGNOSTIC at a later time (though they are not too expensive to leave as is) o change ether_demux to eliminate the passing of the Ethernet header; it is now expected at the front of the packet a la ether_input o add ether_sprintf compatibility shim o change ether_ifattach API to remove "bpf supported param" and add a pointer to the MAC address to be installed for the LL address (this is for future changes to divest struct arpcom from struct ifnet) o change ether_ifdetach API to remove "bpf support param" Reviewed by: many Approved by: re
* general cleanups mostly aimed at improving portability of driverssam2002-11-141-43/+38
| | | | | | | | | | | | | | o ETHER_* (ETHER_ALIGN, ETHER_MAX_FRAME, ETHER_CRC_LEN, etc.) o M_HASFCS for drivers to indicate packets include FCS o remove global declarations for ng_ether* and vlan_* since these represent a private contract between the if_ethersubr.c code and certain parts of the system that should not normally be abused o add ether_* declarations that were elsewhere o remove ETHER_BPF_* since they are no longer used with the parameter no longer passed to ether_ifattach and ether_ifdetach Reviewed by: many Approved by: re
* o add support for multiple link types per interface (e.g. 802.11 and Ethernet)sam2002-11-143-27/+53
| | | | | | | | | | o introduce BPF_TAP and BPF_MTAP macros to hide implementation details and ease code portability o use m_getcl where appropriate Reviewed by: many Approved by: re Obtained from: NetBSD (multiple link type support)
* o add IF_*bps macros for netbsd compatibilitysam2002-11-141-0/+11
| | | | | | | o add interface capabilities for vlan use and to signal jumbo frame support Reviewed by: many Approved by: re
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-092-15/+15
| | | | Verified by: md5
* Add a cast to quiet a warning.jhb2002-11-071-1/+1
|
* Don't check IFF_RUNNING in previous change.simokawa2002-10-251-2/+2
| | | | | The flag is sometimes unset if the interface has IPv6 link-local address only.
OpenPOWER on IntegriCloud