summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2008-04-26Typo, paket -> packet.Brad Smith
2008-04-24the softnet intr handlers check if the input queue has packets onDavid Gwynne
it by reading the queues head pointer. if that pointer is not null then it takes splnet and dequeues a packet for handling. this is bad because the ifqueue head is modified at splnet and the sofnet handlers read it without holding splnet. this removes that check of the head pointer and simply checks if the dequeue gave us a packet or not before proceeding. found while reading mpls code. discussed with norby@ and henning@ ok mcbride@ henning@
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-03-20Adapt maximum MTU permitted on pppoe(4) interfaces to the MTU of theBrad Smith
connected Ethernet/VLAN interface. From NetBSD Tested by brad@ sthen@ ok canacar@
2008-03-18Don't use ph after the m_pulldown() calls because the mbuf chain could beClaudio Jeker
modified. Better save than sorry. OK canacar@
2008-03-18Don't use MBUFLOCK() for ifqueue protection use the correct splnet() danceClaudio Jeker
instead. OK canacar@
2008-03-14Do not allow pppoe(4) interfaces to be attached to anything but EthernetBrad Smith
or VLAN interfaces. Based on a similar change from NetBSD. ok canacar@
2008-03-12Include relay-sid in the response if one was received.Can Erkin Acar
Reported and tested by Zach Wilkinson ok brad@, claudio@
2008-02-20make return-rst work correctly in the IPv6 case again.Henning Brauer
broken by me almost a year ago with the proto_checksum changes :( problem noticed & fix tested by Helmut Schneider <jumper99@gmx.de> narrowed down & ok dhartmei
2008-02-20Fix a mbuf leak which can be triggered on a systemBrad Smith
receiving PPPoE packets but without any PPPoE interfaces setup. From mickey@ via PR 5713. ok canacar@ claudio@ dlg@
2008-02-16switch to RFC 1948 style ISN, too; ok mcbride, dhartmei, henningMarkus Friedl
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-25Prevent USB network devices to generate a page fault trap when detachedMarcus Glocker
while UP and holding an open bpf handler by checking bpfilter_lookup() for returning NULL in bpfpoll(). Added an XXX comment which reminds us to recheck why this race condition happens in conjunction with the USB stack. Commented by miod@ and thib@ (would prefer to directly fix race condition, if this is possible at all). lot of help and OK claudio@
2008-01-19Fix add_net_randomness() not being called because the wrongMarco Pfatschbacher
bit in netisr is set. 1 != (1 << 1). Reported by mickey, fix by me. OK markus@, miod@, claudio@
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@
2008-01-12Kill all timeouts and undo carp demotion on pfsync_clone_destroy.Marco Pfatschbacher
Panic reported by deraadt. OK henning@
2008-01-10return with ENOTTY instead of EINVAL for unknown ioctl requests to trunkBrad Smith
ports. ok reyk@ dlg@
2008-01-05make sure all callers of rtlabel_id2name check for a null return value.Henning Brauer
all the original ones did, the recently added ones for labels per interface didn't. no cookie for reyk ;( ok deraadt
2008-01-05rtlabel_id2name() can return NULL if there is no route label..Theo de Raadt
from chris@nmedia.net
2008-01-02Accept BPF_MUL as a valid instruction in bpf_validate() also improveCan Erkin Acar
the comments. Based on diff from Guy Harris
2007-12-30In pf_normalize_tcpopt() call pf_pull_hdr() address family safe.Marcus Glocker
OK dhartmei@
2007-12-30Make "scrub max-mss" rule work correctly;Marcus Glocker
In pf_normalize_tcpopt() pull the TCP options before processing them. This gets the correct TCP options even if an mbuf chain was used, instead like now pointing into an invalid mbuf data buffer. Will close PR 5623. Diff done together with dhartmei@. OK dhartmei@
2007-12-20increment the match/nomatch table counters when using a table/pool inReyk Floeter
rdr rules. this helps to get some statistics about l3 redirections. ok henning@
2007-12-20return with ENOTTY instead of EINVAL for unknown ioctl requests.Brad Smith
ok claudio@ krw@ jason@ dlg@
2007-12-14add sysctl entry points into various network layers, in particular toTheo de Raadt
provide netstat(1) with data it needs; ok claudio reyk
2007-12-05Revert change which seems to break things like dhclient. Requested byKenneth R Westerback
deraadt@.
2007-12-041500 is a 'magic number' in the protocol that all implementationsClaudio Jeker
must be able to handle as MRU but while testing pppoe(4) against a pppoe(8) server I figured out that pppoe(8) insists on a MRU 1492. Because of this we allow the offered MRU to be between PP_MIN_MRU and PP_MAX_MRU especially because the MRU is not used at all as long as it is smaller then PP_MAX_MRU. OK canacar@
2007-12-04Always compare the nexthop if one is specified even if it is a non-multipathClaudio Jeker
route. This mostly affects "route delete" and it will not remove the last route if previous delete is redone. OK henning@
2007-12-02DIOC{GET,ADD}STATE incorrectly use a user provided pointer without usingChristopher Pascoe
copyin/out. Change the API so that the state is included in the ioctl argument, so the ioctl wrappers take care of copying memory as appropriate. Also change the DIOCGETSTATE API to be more useful. Instead of getting an arbitrarily "numbered" state (using numbering that can change between calls), instead search based on id and creatorid. If you want to monitor only a particular state, you can now use the bulk functions first to find the appropriate id/creatorid and then fetch it directly from then on. ok dlg@ henning@
2007-12-02When pf_insert_state state succeeds, increase the state count on theChristopher Pascoe
default rule. When pf_insert_state fails, it's because a matching state already exists. Return a better error code to the user in this case. ok henning@ dlg@
2007-12-02initialize altq->altq_disc to NULL, from Max LaierDaniel Hartmeier
2007-12-02Don't put state key if pf_insert_state fails. pf_detach_state would haveChristopher Pascoe
put it for us already. Also, fix cut-n-paste error in previous commit. ok dlg@ henning@
2007-12-02Don't leak state if key allocation fails during add.Christopher Pascoe
ok dlg@ henning@
2007-12-02Set expiry timestamp when importing a state, otherwise it expires on theChristopher Pascoe
next expiry run. ok dlg@ henning@
2007-12-02DIOCADDSTATE would always dereference a NULL pointer during this copyChristopher Pascoe
and what it was copying would get overwritten anyway. Remove the copy and avoid a panic. DIOCGETSTATE would incorrectly dereference a pointer to a pointer, causing another panic. Fix this.
2007-11-27typos; ok jmc@Martynas Venckus
sys/dev/pci/pciide.c from naddy@
2007-11-26typos; ok jmc@Martynas Venckus
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
2007-11-24some spelling fixes from Martynas VenckusJason McIntyre
2007-11-22pf_src_tree_remove_state() is called upon pf_insert_state() failures.Henning Brauer
but pf_insert_state does fiddle with the state's state_key pointer - it has too -, and can leave it at NULL. pf_src_tree_remove_state() tried to grab the protocol from it. fortunately that is superfluous here, since tcp_est will never be set in the non-tcp case - it is only touched in pf_src_connlimit which in turn is only ever called from pf_test_tcp(). ok mcbride + identical diff from pascoe, but he was a few minutes late :)
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-11-21simplify sppp_chap_scr() now that we are using arc4random_bytes()Can Erkin Acar
2007-11-20Fix possible mbuf leak on error. ok reyk@Can Erkin Acar
2007-11-18backout 1.562 since it triggers the problem described in pr 5648Theo de Raadt
please close the pr after another solution is found for both problems
2007-11-18Sync struct ifaltq to match struct ifqueue.Marco Pfatschbacher
I wonder why 64-bit archs have not been bitten by this. OK mcbride@, henning@
2007-11-16in pf_test_fragment(), ignore protocol-specific criteria for packets ofDaniel Hartmeier
different protocols. from Max Laier. ok markus@, henning@
2007-11-16use arc4random_bytes() instead of multiple arc4random() calls;Damien Miller
ok deraadt@ dlg@ henric@ mcbride@
2007-11-11Don't leak pfstatekey upon insert conflict (most often caused via pfsync).Christopher Pascoe
tested david@, ok dhartmei@