summaryrefslogtreecommitdiff
path: root/sys/net/if_ethersubr.c
AgeCommit message (Collapse)Author
2008-04-23Import MPLS (Multi Protocol Label Switching)Esben Norby
MPLS support partly based on the (abandoned?) AYAME project. Basic LSR (Label Switch Router) functionality is present, but not fully functional yet. It is currently possible to insert entries in the LIB (Label Information Base) with route(8), but setting the operation type is not supported yet. Imported to allow more people to work on this in the coming weeks. ok claudio@ laurent@ dlg@
2008-04-18extend the if_ethersubr.c crc functions to support updating a runningDamien Miller
crc in addition to the existing "oneshot" mode and use them to replace ieee80211_crc_update() with the new ether_crc32_le_update(). Saves 1k kernel bss + some code. Mark the new ether_crc32_[lb]e_update functions as __pure for a ~25x speedup (on my i386 at least). feedback and ok damien@
2008-04-10introduce mitigation for the calling of an interfaces start routine.David Gwynne
decent drivers prefer to have a lot of packets on the send queue so they can queue a lot of them up on the tx ring and then post them all in one big chunk. unfortunately our stack queues one packet onto the send queue and then calls the start handler immediately. this mitigates against that queue, send, queue, send behaviour by trying to call the start routine only once per softnet. now its queue, queue, queue, send. this is the result of a lot of discussion with claudio@ tested by many.
2008-04-10Also count multicast packets and input bytes for interfaces enslaved byBrad Smith
trunk(4). PR 5248 ok reyk@
2008-02-05Move carp load balancing (ARP/IP) to a simpler configuration scheme.Marco Pfatschbacher
Instead of using the same IP on multiple interfaces, carp has to be configured with the new "carpnodes" and "balancing" options. # ifconfig carp0 carpnodes 1:0,2:100,3:100 balancing ip carpdev sis0 192.168.5.50 Please note, that this is a flag day for anyone using carp balancing. You'll need to adjust your configuration accordingly. Addititionally this diff adds IPv6 NDP balancing support. Tested and OK mcbride@, reyk@. Manpage help by jmc@.
2008-01-17In ether_input() scheduling the soft interrupt and queueing theAlexander Bluhm
packet have to be protected by the same splnet. Otherwise on architectures where soft interrupts are executed immediately, the interrupt is processed before the packet is in the queue. On real hardware interfaces this was not a problem as ether_input() is called at splnet anyway. But when sending to a tun interface the packet got delayed. ok beck@ miod@ henning@ mpf@ markus@
2007-11-22Factor out the virtual host portion of carp into a separate structMarco Pfatschbacher
that is kept in a list per carp interface. This is the huge first step necessary to make carp load balancing nice and easy. One carp interface can now contain up to 32 virtual host instances. This doesn't do anything useful yet, but here is how an ifconfig for multiple entries now looks like: # ifconfig carp2 carpnodes 5:0,6:100 192.168.5.88 carp2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:00:5e:00:01:05 carp: carpdev sis0 advbase 1 state MASTER vhid 5 advskew 0 state BACKUP vhid 6 advskew 100 groups: carp inet 192.168.5.88 netmask 0xffffff00 broadcast 192.168.5.255 OK mcbride@
2007-09-15malloc sweep:Henning Brauer
-remove useless casts -MALLOC/FREE -> malloc/free -use M_ZERO where appropriate instead of seperate bzero feedback & ok krw, hshoexer
2007-06-06remove remaining IPX hooks. all inside #ifdef IPX, so no actual changeHenning Brauer
2007-05-29there was code insideHenning Brauer
#if NPF > 0 to prevent feeding back the mbuf do looutput if we are on simplex interfaces and the packet has been routed by pf, whch can lead to a loop in weird corner cases. apparently nobody triggered these cases in ages, since pf.h was not included and thus NPF not defined and thus this code not compiled. ok theo
2007-05-16fix return values in bridge_output.Michele Marchetto
OK claudio@ jason@
2007-05-16count the number of multicast ranges that are kept in the list of multicastDavid Gwynne
addresses in struct arpcom. this lets a nic driver easily see if it wants allmulti behaviour, which in turn means we can clean some code up. ok jason@ claudio@ norby@
2007-03-18Add IP load balancing support for carp(4).Marco Pfatschbacher
This provides a similar functionality as ARP balancing, but also works for traffic that comes across routers. IPv6 is supported as well. The configuration scheme will change as soon we have sth better. Also add support for changing the MAC address on carp(4) interfaces. (code from mcbride) Tested by pyr@ and reyk@ OK mcbride@
2006-12-07use LINK_STATE_IS_UP(ifp0->if_link_state) instead ofReyk Floeter
ifp0->if_link_state == LINK_STATE_UP to handle the new half/full duplex link states. i forgot to commit these snippets before. ok jsg@
2006-10-31ether_input_mbuf() isn't necessary, turn it into a macro and deal withJason Wright
it's "special" case in ether_input(). Based on similiar idea in FreeBSD. ok brad
2006-06-16adjust functions dealing with the routing table to take a table ID asHenning Brauer
parameter so they can work on alternate tables. table 0 hardcoded for many callers yet, that will be adapted step by step. input + ok claudio norby hshoexer
2006-05-26rename jumbo mtu to if_hardmtu; ok brad reykTheo de Raadt
2006-05-19add a if_jumbo_mtu field to the interface structure for driversReyk Floeter
supporting ethernet jumbo frames. there's no standard for the size of jumbo MTUs, so either let the driver set it's own value or use 9000 byte jumbo frames by default. ok brad@
2006-03-04With the exception of two other small uncommited diffs this movesBrad Smith
the remainder of the network stack from splimp to splnet. ok miod@
2005-11-03re-implement the bpf "filter drop" option that it actually works. theReyk Floeter
bpf FILDROP interface exists for about one year but the required interface to the drivers was missing - so it was useless. this new approach based on a design by henning@ uses a new mbuf flag to mark filtered packets and to drop them in the generic network stack input routines (like ether_input). for example; after some additional testing, this could be used by dhclient to filter everything except DHCP packets (track tech@ for a corresponding dhclient diff). the "filter dropped" packets won't reach the network stack. so it's probably some kind of a very basic application layer packet filter ;). ok canacar@, discussed with henning@ and others
2005-10-17make pf use one mbuf tag instead of 6 distinct ones. use a little structHenning Brauer
in the data part for the data from the previously distinct tags. look up the tag early and carry a pointer to it around. makes the code easier and saves some tag lookups and thus helps performance, as proven by tests run by Schberle Dniel <Schoeberle.Daniel@aamtech.hu> Initially hacked up somewhere over the atlantic ocean in an A330 early testing reyk and moritz, "put it in" theo
2005-09-30remove old unused NRL IPv6 code.Brad Smith
ok deraadt@
2005-06-08bye bye netns (and a few leftover DECNET bits while here)Henning Brauer
2005-06-07Run vlan_input before bridge_input, and change vlan_input to notCamiel Dobbelaar
consume vlan frames that no vlan interface wants, so they can still be bridged. This way, the bridge can bridge encapsulated frames _and_ bridge between vlan interfaces. ok henning markus
2005-06-07do not handle CCITT any longerHenning Brauer
2005-05-24oopsTheo de Raadt
2005-05-24let ramdisks compile again. people -- please always try to compile with ↵Theo de Raadt
your new options off, too
2005-05-24support trunk stacking (trunks as trunk ports) and some fixesReyk Floeter
ok brad@
2005-05-24initial import of a trunking (link aggregation and link failover)Reyk Floeter
implementation. it currently supports round robin mode with link state checking, additional modes will be added later. ok brad@, deraadt@
2005-04-25Use ETHERTYPE_VLAN.Brad Smith
2005-01-18Rewriting the lladdr can now be done without using mbuf tags.Marco Pfatschbacher
Advertisements run through the carp interface first. So we just take the address from ifp0. While we're there, also remove carp_macmatch6, which isn't used anymore. Proposed by mcbride@ ok mcbride@, pascoe@
2004-12-19Make it possible for carp to work on fddi and token ring again.Ryan Thomas McBride
ok pascoe@ mpf@
2004-12-17Reorder code in the ethernet output path, and enhance unicast addressChristopher Pascoe
matching in the bridge receive path to make CARP operate correctly on physical interfaces that are participating in a bridge. ok mcbride@ henning@ dlg@
2004-12-10Rename carp_output() to carp_fix_lladdr().Ryan Thomas McBride
2004-12-09Remove shadow variable 'error'. From camield@Ryan Thomas McBride
2004-12-07Convert carp(4) to behave more like a regular interface, much in the sameRyan Thomas McBride
style as vlan(4). carp interfaces no longer require the physical interface to be on the same subnet as the carp interface, or even that the physical interface has an adress at all, so CARP can now be used on /30 networks. ok deraadt@ henning@
2004-12-07KNFRyan Thomas McBride
2004-11-28In kernel pppoe client, a simple IPv4 only implementation.Can Erkin Acar
Initial porting from NetBSD by David Berghoff. Modified/simplified to match our sppp implementation. ok deraadt@
2004-10-09sizeof(struct ether_header) -> ETHER_HDR_LENBrad Smith
ok mcbride@
2004-07-16remove netiso shitz, millert okHenning Brauer
2004-06-26Add a table-driven implementation of ether_crc32_be().Christian Weisgerber
From Seishi Hiragushi via FreeBSD PR kern/49957. Also, while we're here, make the loop counter size_t. ok mcbride@
2004-06-21First step towards more sane time handling in the kernel -- this changesThorsten Lockert
things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@
2004-04-17add a congestion indicator to if_queue. It is set when the input queueHenning Brauer
is full, along with a timer that unsets it again after 10ms. The input queue beeing full is a reliable indicator for CPU overload, and this flag allows other subsystems to cope with the situation. hacked with beck ok kjc@ markus@ beck@
2004-02-1518 -> ETHER_ADDR_LEN*3 in ether_sprintf() for clarityAnil Madhavapeddy
itojun@ ok
2004-01-09fix leak ether_deatch(): if if_free_sadl() is called before if_detach()Markus Friedl
then ifnet_addrs[ifp->if_index] leaks; if it's called after if_detach() then if_free_sadl() does nothing; ok itojun
2003-12-10de-register. deraadt okJun-ichiro itojun Hagino
2003-10-25"goto bad" on error with carp_input, instead of simply returning.Ryan Thomas McBride
Fixes leakage of mbufs on error. Pointed out by Max Laier.
2003-10-17Common Address Redundancy ProtocolRyan Thomas McBride
Allows multiple hosts to share an IP address, providing high availability and load balancing. Based on code by mickey@, with additional help from markus@ and Marco_Pfatschbacher@genua.de ok deraadt@
2003-08-18prevent looutput() feedback of broadcast/multicast packets if they areDaniel Hartmeier
pf routed. prevents a kernel lockup with some (non-sensical) route-to rules. report and debugging by mpech@. ok itojun@, henning@, mpech@.
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.