summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
Commit message (Collapse)AuthorAgeFilesLines
* Moved the updating of if_ibytes from ether_demux() to ether_input() to fixdg2001-12-141-1/+2
| | | | | | | a bug where the interface input bytes count wasn't updated when bridging is enabled. MFC after: 3 days
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-1/+1
| | | | also don't use ANSI string concatenation.
* Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from thebrooks2001-12-031-1/+1
| | | | | | mbuf instead. Suggested by: fenner
* MFS: sync the ipfw/dummynet/bridge code with the one recently mergedluigi2001-11-041-7/+7
| | | | into stable (mostly , but not only, formatting and comments changes).
* bring in ARP support for variable length link level addressesfjoe2001-10-141-2/+3
| | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks
* Set if_type and if_addrlen before calling if_attach(), so the values arejlemon2001-10-111-1/+1
| | | | available for the routine to use.
* Make it so dummynet and bridge can be loaded as modules.ps2001-10-051-24/+18
| | | | Submitted by: billf
* Remove/comment tokens after #endif (#endif NETATALK)peter2001-09-101-2/+2
|
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-1/+1
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* Make vlan(4) loadable, unloadable, and clonable. As a side effect,brooks2001-09-051-13/+7
| | | | | | | interfaces must now always enable VLAN support. Reviewed by: jlemon MFC after: 3 weeks
* Do not perform arp send/resolve on an interface marked NOARP.jlemon2001-06-151-0/+5
| | | | | PR: 25006 MFC after: 2 weeks
* Get IP multicast working on VLAN devices:fenner2001-05-021-6/+2
| | | | | | | | | | | - Allocate zeroed memory in ether_resolvemulti() to prevent equal() from comparing garbage and determining that two otherwise-equal sockaddr_dls are different. - Fill in all required fields of the sockaddr_dl - Actually copy the multicast address into the sockaddr_dl when calling if_addmulti() - Don't claim that we don't have a way to resolve layer 3 addresses into layer 2 addresses; use the ethernet way.
* Plug several mbuf leaks in error cases (in nd6)bmilekic2001-03-111-2/+1
| | | | Submitted by: jhay
* Insert entropy harvesting calls for network traffic. Bymarkm2001-02-181-0/+4
| | | | default, no entropy will be harvested.
* Sync with the bridge/dummynet/ipfw code already tested in stable.luigi2001-02-101-6/+1
| | | | | In ip_fw.[ch] change a couple of variable and field names to avoid having types, variables and fields with the same name.
* When we receive an incoming Ethernet frame that was unicast to aarchie2001-02-081-10/+14
| | | | | | | | | different hardware address, we should drop it (this should only happen in promiscuous mode). Relocate the code for this check from before ng_ether(4) processing to after ng_ether(4) processing. Also fix a compiler warning. PR: kern/24465
* MFS: bridge/ipfw/dummynet fixes (bridge.c will be committed separately)luigi2001-02-021-10/+23
|
* Comment the interface to ether_input() and the way is normallyluigi2001-01-251-0/+9
| | | | used by most ethernet drivers.
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-2/+2
| | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
* Remove unused variable, spl() manipulation isn't done for the ifq now.jlemon2000-11-251-1/+0
|
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-31/+7
| | | | | | | | | | | | | | 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.
* Properly setup link level header length for 802.2 and SNAP frames.bp2000-09-301-2/+2
|
* Get rid of a panic that occurs in ether_demux() by dereferencing a NULL mbufbmilekic2000-09-241-1/+9
| | | | | | | | | 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
* Make the bridge_refresh operation automatic when ethernet interfacesnsayer2000-07-291-0/+6
| | | | are attached or detached.
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-5/+21
| | | | | | | | | ether_ifdetach(). The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations. Reviewed by: julian, freebsd-net
* repair IPV6_JOIN_GROUP to IPv6 all multi.itojun2000-07-091-0/+10
| | | | From: ume
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-07-041-4/+0
| | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change)
* Fix kernel build breakage when 'device ether' was not included.archie2000-06-291-11/+0
|
* Make the ng_ether(4) node type dynamically loadable like the rest.archie2000-06-261-422/+96
| | | | | | | | | | | | | This means 'options NETGRAPH' is no longer necessary in order to get netgraph-enabled Ethernet interfaces. This supports loading/unloading the ng_ether.ko and attaching/detaching the Ethernet interface in any order. Add two new hooks 'upper' and 'lower' to allow access to the protocol demux engine and the raw device, respectively. This enables bridging to be defined as a netgraph node, if so desired. Reviewed by: freebsd-net@freebsd.org
* Do not perform any opeartion with mbuf after it placed intobp2000-06-141-5/+5
| | | | | | interface queue. Tested by: Bosko Milekic <bmilekic@dsuper.net>
* Just need to pass the address family to if_simloop(), not the whole sockaddr.archie2000-05-241-2/+2
|
* Move code to handle BPF and bridging for incoming Ethernet packets outarchie2000-05-141-8/+61
| | | | | | | | | | | | | | | 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
* OOps forgot to check in this one...julian2000-04-281-3/+4
| | | | API chage for netgraph.
* Fix support for 802.2 and SNAP frames. Bug was introduced duringbp2000-04-271-6/+4
| | | | | | initial import. Tested by: Jorge P Vasquez <jorge@acron.ind.br>
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-171/+4
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).green1999-12-191-3/+2
|
* Bring up an if_ef driver which allows support for four ethernetbp1999-12-131-1/+17
| | | | | | | frame types. Currently it supports only IPX protocol and doesn't affect existing functionality when not loaded. Reviewed by: Ollivier Robert <roberto@keltia.freenix.fr>
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-071-0/+1
| | | | | | | | | | packet divert at kernel for IPv6/IPv4 translater daemon This includes queue related patch submitted by jburkhol@home.com. Submitted by: queue related patch from jburkhol@home.com Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Add two new generic control messages, NGM_ASCII2BINARY andarchie1999-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | NGM_BINARY2ASCII, which convert control messages to ASCII and back. This allows control messages to be sent and received in ASCII form using ngctl(8), which makes ngctl a lot more useful. This also allows all the type-specific debugging code in libnetgraph to go away -- instead, we just ask the node itself to do the ASCII translation for us. Currently, all generic control messages are supported, as well as messages associated with the following node types: async, cisco, ksocket, and ppp. See /usr/share/examples/netgraph/ngctl for an example of using this. Also give ngctl(8) the ability to print out incoming data and control messages at any time. Eventually nghook(8) may be subsumed. Several other misc. bug fixes. Reviewed by: julian
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-11-221-22/+68
| | | | | | | | | | for IPv6 yet) With this patch, you can assigne IPv6 addr automatically, and can reply to IPv6 ping. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* YUCK!julian1999-11-151-2/+2
| | | | | m_prepend doesn't fix m_pkthdr.len, use M_PREPEND instead, which does.. (Netgraph only)
* Fix screwup on synthesising incoming ethernet header in Netgraph mode.julian1999-11-141-2/+3
| | | | Submitted by: brian@freebsd.org
* Oops forgot to put the source MAC address on outgoing packets!julian1999-11-111-1/+3
|
* Use typedefs for node methods.julian1999-11-011-9/+7
|
* Minor hack in the netgraph interface to ethernets.julian1999-10-261-11/+60
|
* Whistle's Netgraph link-layer (sometimes more) networking infrastructure.julian1999-10-211-0/+349
| | | | | | | | | | Been in production for 3 years now. Gives Instant Frame relay to if_sr and if_ar drivers, and PPPOE support soon. See: ftp://ftp.whistle.com/pub/archie/netgraph/index.html for on-line manual pages. Reviewed by: Doug Rabson (dfr@freebsd.org) Obtained from: Whistle CVS tree
* Implement pseudo_AF_HDRCMPLT, which controls the state of the 'headermsmith1999-10-151-4/+14
| | | | | | | | | | completion' flag. If set, the interface output routine will assume that the packet already has a valid link-level source address. This defaults to off (the address is overwritten) PR: kern/10680 Submitted by: "Christopher N . Harrell" <cnh@mindspring.net> Obtained from: NetBSD
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-1/+2
| | | | | | | | | | 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)
* Slight cleanups. There were 2 ways of getting the arpcom from the ifp.julian1999-01-311-23/+22
| | | | | Both equally bogus. Make it a macro so that we can pretend it's not bogus and maybe make it less so some time in the future.
OpenPOWER on IntegriCloud