summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove __P.Alfred Perlstein2002-03-191-2/+2
| | | | Notes: svn path=/head/; revision=92725
* Remove useless initialization to 0 of a couple of global variables.Luigi Rizzo2002-02-151-2/+2
| | | | Notes: svn path=/head/; revision=90677
* It turns out that when a broadcast packet is looped back, the checksumsJesper Skriver2002-01-111-0/+13
| | | | | | | | | | | | | | | are checked on the way in even if they were not calculated on the way out. This fixes rwhod PR: 31954 Submitted by: fenner Approved by: fenner MFC after: 1 week Notes: svn path=/head/; revision=89263
* minor style fix.Jonathan Lemon2001-12-141-0/+1
| | | | Notes: svn path=/head/; revision=87912
* Moved the updating of if_ibytes from ether_demux() to ether_input() to fixDavid Greenman2001-12-141-1/+2
| | | | | | | | | | a bug where the interface input bytes count wasn't updated when bridging is enabled. MFC after: 3 days Notes: svn path=/head/; revision=87843
* Update to C99, s/__FUNCTION__/__func__/,David E. O'Brien2001-12-101-1/+1
| | | | | | | also don't use ANSI string concatenation. Notes: svn path=/head/; revision=87599
* Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from theBrooks Davis2001-12-031-1/+1
| | | | | | | | | mbuf instead. Suggested by: fenner Notes: svn path=/head/; revision=87276
* MFS: sync the ipfw/dummynet/bridge code with the one recently mergedLuigi Rizzo2001-11-041-7/+7
| | | | | | | into stable (mostly , but not only, formatting and comments changes). Notes: svn path=/head/; revision=86047
* bring in ARP support for variable length link level addressesMax Khon2001-10-141-2/+3
| | | | | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks Notes: svn path=/head/; revision=84931
* Set if_type and if_addrlen before calling if_attach(), so the values areJonathan Lemon2001-10-111-1/+1
| | | | | | | available for the routine to use. Notes: svn path=/head/; revision=84785
* Make it so dummynet and bridge can be loaded as modules.Paul Saab2001-10-051-24/+18
| | | | | | | Submitted by: billf Notes: svn path=/head/; revision=84516
* Remove/comment tokens after #endif (#endif NETATALK)Peter Wemm2001-09-101-2/+2
| | | | Notes: svn path=/head/; revision=83268
* Wrap array accesses in macros, which also happen to be lvalues:Jonathan Lemon2001-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. Notes: svn path=/head/; revision=83130
* Make vlan(4) loadable, unloadable, and clonable. As a side effect,Brooks Davis2001-09-051-13/+7
| | | | | | | | | | interfaces must now always enable VLAN support. Reviewed by: jlemon MFC after: 3 weeks Notes: svn path=/head/; revision=83115
* Do not perform arp send/resolve on an interface marked NOARP.Jonathan Lemon2001-06-151-0/+5
| | | | | | | | PR: 25006 MFC after: 2 weeks Notes: svn path=/head/; revision=78295
* Get IP multicast working on VLAN devices:Bill 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. Notes: svn path=/head/; revision=76213
* Plug several mbuf leaks in error cases (in nd6)Bosko Milekic2001-03-111-2/+1
| | | | | | | Submitted by: jhay Notes: svn path=/head/; revision=74093
* Insert entropy harvesting calls for network traffic. ByMark Murray2001-02-181-0/+4
| | | | | | | default, no entropy will be harvested. Notes: svn path=/head/; revision=72669
* Sync with the bridge/dummynet/ipfw code already tested in stable.Luigi Rizzo2001-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. Notes: svn path=/head/; revision=72270
* When we receive an incoming Ethernet frame that was unicast to aArchie Cobbs2001-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 Notes: svn path=/head/; revision=72175
* MFS: bridge/ipfw/dummynet fixes (bridge.c will be committed separately)Luigi Rizzo2001-02-021-10/+23
| | | | Notes: svn path=/head/; revision=71909
* Comment the interface to ether_input() and the way is normallyLuigi Rizzo2001-01-251-0/+9
| | | | | | | used by most ethernet drivers. Notes: svn path=/head/; revision=71655
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.Bosko Milekic2000-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. Notes: svn path=/head/; revision=70254
* Remove unused variable, spl() manipulation isn't done for the ifq now.Jonathan Lemon2000-11-251-1/+0
| | | | Notes: svn path=/head/; revision=69153
* Lock down the network interface queues. The queue mutex must be obtainedJonathan Lemon2000-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. Notes: svn path=/head/; revision=69152
* Properly setup link level header length for 802.2 and SNAP frames.Boris Popov2000-09-301-2/+2
| | | | Notes: svn path=/head/; revision=66479
* Get rid of a panic that occurs in ether_demux() by dereferencing a NULL mbufBosko Milekic2000-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 Notes: svn path=/head/; revision=66316
* Make the bridge_refresh operation automatic when ethernet interfacesNick Sayer2000-07-291-0/+6
| | | | | | | are attached or detached. Notes: svn path=/head/; revision=63992
* Make all Ethernet drivers attach using ether_ifattach() and detach usingArchie Cobbs2000-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 Notes: svn path=/head/; revision=63090
* repair IPV6_JOIN_GROUP to IPv6 all multi.Jun-ichiro itojun Hagino2000-07-091-0/+10
| | | | | | | From: ume Notes: svn path=/head/; revision=62838
* sync with kame tree as of july00. tons of bug fixes/improvements.Jun-ichiro itojun Hagino2000-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) Notes: svn path=/head/; revision=62587
* Fix kernel build breakage when 'device ether' was not included.Archie Cobbs2000-06-291-11/+0
| | | | Notes: svn path=/head/; revision=62264
* Make the ng_ether(4) node type dynamically loadable like the rest.Archie Cobbs2000-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 Notes: svn path=/head/; revision=62143
* Do not perform any opeartion with mbuf after it placed intoBoris Popov2000-06-141-5/+5
| | | | | | | | | interface queue. Tested by: Bosko Milekic <bmilekic@dsuper.net> Notes: svn path=/head/; revision=61648
* Just need to pass the address family to if_simloop(), not the whole sockaddr.Archie Cobbs2000-05-241-2/+2
| | | | Notes: svn path=/head/; revision=60889
* Move code to handle BPF and bridging for incoming Ethernet packets outArchie Cobbs2000-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 Notes: svn path=/head/; revision=60536
* OOps forgot to check in this one...Julian Elischer2000-04-281-3/+4
| | | | | | | API chage for netgraph. Notes: svn path=/head/; revision=59731
* Fix support for 802.2 and SNAP frames. Bug was introduced duringBoris Popov2000-04-271-6/+4
| | | | | | | | | initial import. Tested by: Jorge P Vasquez <jorge@acron.ind.br> Notes: svn path=/head/; revision=59681
* Clean up some loose ends in the network code, including the X.25 and ISOPeter Wemm2000-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 Notes: svn path=/head/; revision=57178
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).Brian Feldman1999-12-191-3/+2
| | | | Notes: svn path=/head/; revision=54799
* Bring up an if_ef driver which allows support for four ethernetBoris Popov1999-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> Notes: svn path=/head/; revision=54558
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,Yoshinobu Inoue1999-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 Notes: svn path=/head/; revision=54263
* Add two new generic control messages, NGM_ASCII2BINARY andArchie Cobbs1999-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 Notes: svn path=/head/; revision=53913
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPYoshinobu Inoue1999-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 Notes: svn path=/head/; revision=53541
* YUCK!Julian Elischer1999-11-151-2/+2
| | | | | | | | m_prepend doesn't fix m_pkthdr.len, use M_PREPEND instead, which does.. (Netgraph only) Notes: svn path=/head/; revision=53171
* Fix screwup on synthesising incoming ethernet header in Netgraph mode.Julian Elischer1999-11-141-2/+3
| | | | | | | Submitted by: brian@freebsd.org Notes: svn path=/head/; revision=53144
* Oops forgot to put the source MAC address on outgoing packets!Julian Elischer1999-11-111-1/+3
| | | | Notes: svn path=/head/; revision=53099
* Use typedefs for node methods.Julian Elischer1999-11-011-9/+7
| | | | Notes: svn path=/head/; revision=52754
* Minor hack in the netgraph interface to ethernets.Julian Elischer1999-10-261-11/+60
| | | | Notes: svn path=/head/; revision=52525
* Whistle's Netgraph link-layer (sometimes more) networking infrastructure.Julian Elischer1999-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 Notes: svn path=/head/; revision=52419