summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Const-poison ip_stf_ttl to make it clear that the variable is notrwatson2004-03-071-1/+1
| | | | modified at run-time.
* Two minor follow-ups on the MT_TAG removal:mlaier2004-03-021-3/+0
| | | | | | | | ifp is now passed explicitly to ether_demux; no need to look it up again. Make mtag a global var in ip_input. Noticed by: rwatson Approved by: bms(mentor)
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherrwatson2004-03-011-2/+3
| | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam
* Define BPFD_LOCK_ASSERT() to assert the BPF descriptor lock.rwatson2004-02-291-0/+1
| | | | | | | | Assert the BPF descriptor lock in the MAC calls referencing live BPF descriptors. Obtained from: TrustedBSD Project Sponsored by: DARPA, McAfee Research
* Grab Giant after MAC processing on outgoing packets being sent viarwatson2004-02-291-1/+3
| | | | | | | | BPF. Grab the BPF descriptor lock before entering MAC since the MAC Framework references BPF descriptor fields, including the BPF descriptor label. Submitted by: sam
* Bring eventhandler callbacks for pf.mlaier2004-02-262-0/+20
| | | | | | | | This enables pf to track dynamic address changes on interfaces (dailup) with the "on (<ifname>)"-syntax. This also brings hooks in anticipation of tracking cloned interfaces, which will be in future versions of pf. Approved by: bms(mentor)
* Tweak existing header and other build infrastructure to be able to buildmlaier2004-02-262-0/+3
| | | | | | | pf/pflog/pfsync as modules. Do not list them in NOTES or modules/Makefile (i.e. do not connect it to any (automatic) builds - yet). Approved by: bms(mentor)
* Re-remove MT_TAGs. The problems with dummynet have been fixed now.mlaier2004-02-252-23/+8
| | | | | Tested by: -current, bms(mentor), me Approved by: bms(mentor), sam
* Don't set d_flags twice. The second setting clobbered D_NOGIANT.bde2004-02-242-4/+2
|
* Device megapatch 4/6:phk2004-02-214-0/+8
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 2/6:phk2004-02-214-285/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a couple of functions for pseudodrivers to use for implementing cloning in a manner we will be able to lock down (shortly). Basically what happens is that pseudo drivers get a way to ask for "give me the dev_t with this unit number" or alternatively "give me a dev_t with the lowest guaranteed free unit number" (there is unfortunately a lot of non-POLA in the exact numeric value of this number, just live with it for now) Managing the unit number space this way removes the need to use rman(9) to do so in the drivers this greatly simplifies the code in the drivers because even using rman(9) they still needed to manage their dev_t's anyway. I have taken the if_tun, if_tap, snp and nmdm drivers through the mill, partly because they (ab)used makedev(), but mostly because together they represent three different problems for device-cloning: if_tun and snp is the plain case: just give me a device. if_tap has two kinds of devices, with a flag for device type. nmdm has paired devices (ala pty) can you can clone either of them.
* Device megapatch 1/6:phk2004-02-211-3/+1
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Minor beautifications related to style(9) and code consistency.yar2004-02-211-5/+5
| | | | No functional changes.
* Improve the SIOCSIFCAP handler a bit:yar2004-02-211-1/+5
| | | | | | | - allow for ifp->if_ioctl being NULL, as the rest of ifioctl() does; - give the interface driver a chance to report a error to the caller; - don't forget to update ifp->if_lastchange upon successful modification of interface operation parameters.
* Backout MT_TAG removal (i.e. bring back MT_TAGs) for now, as dummynet ismlaier2004-02-182-7/+24
| | | | | | not working properly with the patch in place. Approved by: bms(mentor)
* Random style fixes and a comment update. No functional changes.des2004-02-161-4/+4
|
* Return EACCES rather than ENOBUFS if ipfw blocks a packet on thedwmalone2004-02-151-1/+1
| | | | | | | | | way out at layer 2. PR: 62385 Submitted by: Oleg Bulyzhin <oleg@rinet.ru> Approved by: luigi MFC after: 1 week
* This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacingmlaier2004-02-132-24/+7
| | | | | | | | | | | them mostly with packet tags (one case is handled by using an mbuf flag since the linkage between "caller" and "callee" is direct and there's no need to incur the overhead of a packet tag). This is (mostly) work from: sam Silence from: -arch Approved by: bms(mentor), sam, rwatson
* Initial import of RFC 2385 (TCP-MD5) digest support.bms2004-02-111-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of two commits; bringing in the kernel support first. This can be enabled by compiling a kernel with options TCP_SIGNATURE and FAST_IPSEC. For the uninitiated, this is a TCP option which provides for a means of authenticating TCP sessions which came into being before IPSEC. It is still relevant today, however, as it is used by many commercial router vendors, particularly with BGP, and as such has become a requirement for interconnect at many major Internet points of presence. Several parts of the TCP and IP headers, including the segment payload, are digested with MD5, including a shared secret. The PF_KEY interface is used to manage the secrets using security associations in the SADB. There is a limitation here in that as there is no way to map a TCP flow per-port back to an SPI without polluting tcpcb or using the SPD; the code to do the latter is unstable at this time. Therefore this code only supports per-host keying granularity. Whilst FAST_IPSEC is mutually exclusive with KAME IPSEC (and thus IPv6), TCP_SIGNATURE applies only to IPv4. For the vast majority of prospective users of this feature, this will not pose any problem. This implementation is output-only; that is, the option is honoured when responding to a host initiating a TCP session, but no effort is made [yet] to authenticate inbound traffic. This is, however, sufficient to interwork with Cisco equipment. Tested with a Cisco 2501 running IOS 12.0(27), and Quagga 0.96.4 with local patches. Patches for tcpdump to validate TCP-MD5 sessions are also available from me upon request. Sponsored by: sentex.net
* Add the kernel side of network interface renaming support.brooks2004-02-041-23/+56
| | | | | | | | | | | | | | | The basic process is to send a routing socket announcement that the interface has departed, change if_xname, update the sockaddr_dl associated with the interface, and announce the arrival of the interface on the routing socket. As part of this change, ifunit() is greatly simplified by testing if_xname directly. if_clone_destroy() now uses if_dname to look up the cloner for the interface and if_dunit to identify the unit number. Reviewed by: ru, sam (concept) Vincent Jardin <vjardin AT free.fr> Max Laier <max AT love2party.net>
* More macro cleanup. Use the system roundup2() macro instead of makingbrooks2004-02-021-3/+1
| | | | | | our own ROUNDUP() macro. Suggested by: bde
* Remove NetBSD'isms (add FreeBSD'isms?), which makes gre(4) working again.sobomax2004-01-301-3/+2
|
* Cleanup malloc() use in if_attach():brooks2004-01-271-22/+20
| | | | | | | - malloc() returns a void* and does not need a cast - when called with M_WAITOK, malloc() can not return NULL so don't check for that case. The result of the check was bogus anyway since it would leave the interface broken.
* Clean up macro usage in if_attach():brooks2004-01-271-2/+2
| | | | | - Use the system offsetof macro rather then making out own. - undef ROUND after we use it rather then polluting the whole file.
* Add support for WCCPv2. It should be enablem manually using link2sobomax2004-01-262-0/+17
| | | | | | | | ifconfig(8) flag since header for version 2 is the same but IP payload is prepended with additional 4-bytes field. Inspired by: Roman Synyuk <roman@univ.kiev.ua> MFC after: 2 weeks
* (whilespace-only)sobomax2004-01-262-11/+11
| | | | Kill trailing spaces.
* Add a device type for virtual interfaces.harti2004-01-261-1/+3
|
* Add an ATM sub-type for virtual interfaces.harti2004-01-261-0/+3
|
* Don't panic if there are more than 255 interfaces in the system.ru2004-01-231-1/+2
|
* Fix definition of IFM_MODE, which should be refrected the change ofonoe2004-01-221-1/+1
| | | | | IFM_IEEE80211_ mode. Also ifconfig(8) must be recompiled. Pointed out by Sam Leffeler.
* Remove #ifdef for ancient source FreeBSD compat.phk2004-01-211-11/+0
|
* Don't leak softc's when destroying interfaces.brooks2004-01-211-0/+3
| | | | | | Init the softc list when loaded. Noticed by: Maurycy Pawlowski-Wieronski <maurycy at fouk dot org>
* A network interface driver can support IFCAP_VLAN_MTU only,yar2004-01-181-3/+3
| | | | | | | without IFCAP_VLAN_HWTAGGING. The previous version of the leading comment in this file could lead to the opposite conclusion. Fix some typos in the comment as well.
* Add support for FH phy, which will be used by awi driver.onoe2004-01-151-3/+7
| | | | | Also some if_media constants to indicate operational mode are changed to bitmasks to reduce diffs from NetBSD.
* Fix a warning when NATM is not defined. In this case s is not used.harti2004-01-091-0/+2
|
* Remove extraneous unlock. This fixes a panic seen when manipulating staticsam2004-01-071-1/+1
| | | | entries in the ARP table.
* backout the switch to use a zone for vlan tags; this requiressam2004-01-032-29/+6
| | | | vlans be present if any driver with h/w vlan tagging is configured
* switch vlan packet tag allocation to use a private zonesam2004-01-022-6/+29
|
* Sync with NetBSD:sobomax2003-12-302-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if_gre.c rev.1.41-1.49 o Spell output with two ts. o Remove assigned-to but not used variable. o fix grammatical error in a diagnostic message. o u_short -> u_int16_t. o gi_len is ip_len, so it has to be network byteorder. if_gre.h rev.1.11-1.13 o prototype must not have variable name. o u_short -> u_int16_t. o Spell address with two d's. ip_gre.c rev.1.22-1.29 o KNF - return is not a function. o The "osrc" variable in gre_mobile_input() is only ever set but not referenced; remove it. o correct (false) assumptions on mbuf chain. not sure if it really helps, but anyways, it is necessary to perform m_pullup. o correct arg to m_pullup (need to count IP header size as well). o remove redundant adjustment of m->m_pkthdr.len. o clear m_flags just for safety. o tabify. o u_short -> u_int16_t. MFC after: 2 weeks
* Unbreak build of bpf-free kernels.tjr2003-12-291-1/+1
|
* o eliminate widespread on-stack mbuf use for bpf by introducingsam2003-12-2810-138/+83
| | | | | | | | | | | | | a new bpf_mtap2 routine that does the right thing for an mbuf and a variable-length chunk of data that should be prepended. o while we're sweeping the drivers, use u_int32_t uniformly when when prepending the address family (several places were assuming sizeof(int) was 4) o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated mbufs have been eliminated; this may better be moved to the bpf routines Reviewed by: arch@ and several others
* Don't truncate the interface name in ifunit(). It's now possible to querygreen2003-12-261-2/+2
| | | | | "very long interface names", e.g.: ndis_atheros0: flags=8847<UP,BROADCAST,DEBUG,RUNNING,SIMPLEX,MULTICAST> mtu 1500
* correct bridge_version: replace unexpanded RCS keywords by a fixed stringsam2003-12-241-1/+1
| | | | PR: kern/60251
* Declare gre(4) as being of IFT_TUNNEL, Like God Intended.bms2003-12-091-2/+2
| | | | Suggested by: fenner
* bandaid LOR in rt_setgate; a proper fix requires code refactoringsam2003-12-071-4/+7
|
* Make the if_broadcastaddr const. All the drivers in the tree whichimp2003-12-071-1/+1
| | | | | | violated the constness were corrected before the freeze. This was suggested by mdodd@, I think, and sam@ and others have signed off on this if I recall my conversations with them correctly.
* Remove the call to M_ASSERTVALID from BPF_MTAP; some mbufs passed tosilby2003-11-281-1/+0
| | | | | | | | | | mpf are allocated on the stack, which causes this check to falsely trigger. A new check which takes on-stack mbufs into account will be reintroduced after 5.2 is out the door. Approved by: re (watson) Requested by: many
* workaround LOR in rt_setgatesam2003-11-251-1/+3
| | | | | Reviewed by: andre Approved by: re (rwatson)
* Introduce tcp_hostcache and remove the tcp specific metrics fromandre2003-11-204-41/+33
| | | | | | | | | | | | | | | | | | | | | | | the routing table. Move all usage and references in the tcp stack from the routing table metrics to the tcp hostcache. It caches measured parameters of past tcp sessions to provide better initial start values for following connections from or to the same source or destination. Depending on the network parameters to/from the remote host this can lead to significant speedups for new tcp connections after the first one because they inherit and shortcut the learning curve. tcp_hostcache is designed for multiple concurrent access in SMP environments with high contention and is hash indexed by remote ip address. It removes significant locking requirements from the tcp stack with regard to the routing table. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
* Remove RTF_PRCLONING from routing table and adjust users of itandre2003-11-202-14/+19
| | | | | | | | | | | | accordingly. The define is left intact for ABI compatibility with userland. This is a pre-step for the introduction of tcp_hostcache. The network stack remains fully useable with this change. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
OpenPOWER on IntegriCloud