summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2015-03-26Remove bits of unfinished IPsec proxy support. DNS' KX records, anyone?Mike Belopuhov
ok markus, hshoexer
2015-03-26Use rt_ifa_add(9) and rt_ifa_del(9) to configure MPLS labels.Martin Pieuchot
Since the removal of the link-layer ifa from "struct ifnet" it was impossible to configure MPLS routes on mpe(4). Because just like enc(4), mpe(4) was abusing the link-layer ifa to attach its route entries. So explicitly pass a "glue" ifa to the routing layer. From Rafael Zalamena who discovered this the hardway, thanks! ok claudio@
2015-03-25introduce code for network input queues. these are to replace theDavid Gwynne
use of struct ifqueue for things handled by softnet. they instead use an mbuf_queue (yay mpsafe) and wrap up the schednetisr and if_congestion handling. ok mpi@
2015-03-18remove the congestion handling from struct ifqueue.David Gwynne
its only used for the ip and ip6 network stack input queues, so it seems unfair that every instance of ifqueue has to carry a pointer around for this specific use case. this moves the congestion marker to a kernel global. if we detect that we're congested, we assume the whole system is busy and punish all input queues. marking a system as congested is done by setting the global to the current value of ticks. as the system moves away from that value, it moves away from being congested until the comparison fails. written at s2k15 ok henning@ beck@ bluhm@ claudio@
2015-03-17Merge two "#ifdef NCARP" chunks.Martin Pieuchot
"Look safe" henning@, ok florian@
2015-03-16When state creations happen in short term by outgoing packets of oneYASUOKA Masahiko
SO_BINDANY socket, the new state didn't have a link of the socket's pcb. So the incoming packets allowed by the state were mistakenly forwarded and the pcb could not get them. Fix pf not to lost the link of the pcb when the state is recreated. ok bluhm mikeb
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-03-04Make sure that rn_mpath_adj_mpflag() is called with the correct pointerClaudio Jeker
to the multipath chain when removing routes. This fixes the sbin/route testcases 17-19 and fixes an annoying opsfd bug because of routes wrongly marked as multipath ones. OK deraadt, mpi, sthen, benno, phessler
2015-03-03make sure hfsc_attach, hfsc_detach, hfsc_addqueue, hfsc_delqueue andHenning Brauer
hfsc_qstats cope with a NULL ifp. Can happen when refering to nonexistant interfaces from pf.conf. Problem noticed and fix tested by Kevin Chadwick <ma1l1ists at yahoo.co.uk>, ok phessler benno
2015-03-03Fix a regression introduced when switching from rtsold to the kernel forBrad Smith
router solicitations. Send the router soliciation right away instead of having a 60 second window between enabling SLAAC on the interface and the router solicitation being sent. ok florian@ stsp@ mpi@
2015-02-20fix a memory leak in the error case found by Maxime Villard's BrainyTed Unangst
code scanner. Changing return to break also fixes a failure to unlock. Also fix a NULL check for that variable noticed by bluhm. ok bluhm henning millert
2015-02-16avoid double vlan-header or vlan-header for non-vlan(4) interfacesMarkus Friedl
(will panic) in bridge context; ok henning@
2015-02-15Rather than using 0xff as a placeholder for "don't check prio", use 0xff toStuart Henderson
mean "prio is 0". This avoids the need for code changes in programs which add pf rules (as was done in pfctl but not other programs) to handle the new "check prio" functionality. Specifically this unbreaks ftp-proxy. Use of #define rather than magic 0xff suggested by benno. ok benno "if henning doesnt like it he can change it when he recovers from jet-lag" (this file missed from previous commit, noticed by daniel@)
2015-02-14Rather than using 0xff as a placeholder for "don't check prio", use 0xff toStuart Henderson
mean "prio is 0". This avoids the need for code changes in programs which add pf rules (as was done in pfctl but not other programs) to handle the new "check prio" functionality. Specifically this unbreaks ftp-proxy. Use of #define rather than magic 0xff suggested by benno. ok benno "if henning doesnt like it he can change it when he recovers from jet-lag"
2015-02-13Include sys/stdint.h for SIZE_MAX instead of relying on the misplacedTodd C. Miller
define in sys/limits.h. OK guenther@
2015-02-12When purging the routes corresponding to an ifp, skip the routing tablesMartin Pieuchot
of different routing domains. The same change has been applied to rt_if_track() in r1.205. ok claudio@
2015-02-12change log(matches) semantics slightly to make it more useful. since itHenning Brauer
is a debug tool change of semantics not considered problematic. up until now, log(matches) forced logging on subsequent matching rules, the actual logging used the log settings from that matched rule. now, log(matches) causes subsequent matches to be logged with the log settings from the log(matches) rule. in particular (this was the driving point), log(matches, to pflog23) allows you to have the trace log going to a seperate pflog interface, not clobbering your regular pflogs, actually not affecting them at all. long conversation with bluhm about it, which didn't lead to a single bit changed in the diff but was very very helpful. ok bluhm as well.
2015-02-11Do not store the key and the gateway of a route entry in the same chunkMartin Pieuchot
of memory. The key (destination) is only set once, when the route is inserted in the routing table, and does not need to change afterward. The gateway might change and rt_setgate() will do all the checks for you. ok claudio@
2015-02-10First step towards making uiomove() take a size_t size argument:Miod Vallat
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
2015-02-10include the "set prio" values.Henning Brauer
no real compat issue since we're using spare bytes. old -> new ends up with set prio (0, 0) equivalent new -> old is entirely harmless, old ignores the prios. requested by Alexey Suslikov <alexey.suslikov at gmail> ok phessler pelikan dlg
2015-02-10since we inherit prio (as in, the queuing priority) from outside sources,Henning Brauer
i. e. on vlan interfaces, it is useful to be able to match on it - effectively matching on classification done elsewhere. i thought i had long implemented that, but chrisz@ asking for it made me notice that wasn't the case. tests by chrisz, ok phessler pelikan
2015-02-10In rt_if_track skip rtables that are not in the rdomain of the ifp.Claudio Jeker
OK mpi@
2015-02-10make bpf(4) able to filter based on a pf(4) queue ID for tcpdump -Q qnameMartin Pelikan
ALTQ version has been on tech@ for years, people were generally ok with it. ok henning
2015-02-09correctly reset max_win if the SYN-ACK lacks a wscale option. pfMarkus Friedl
was setting max_win to 0 and discarded retransmitted SYN-ACK segments without wscale if the original SYN contained a wscale option. with gerhard@, ok henning@
2015-02-09tweak the new if_input function so it takes an mbuf_list insteadDavid Gwynne
of a single mbuf. this forces us to batch work between the hardware rx handlers and the stack. this includes a converstion of bge from ether_input to if_input. ok claudio@ pelikan@ mpi@
2015-02-09move the init of the if_input from ether_ifattach to if_attach.David Gwynne
ok mpi@
2015-02-08Introduce if_input() a function to pass packets dequeued from aMartin Pieuchot
recieving ring to the stack. if_input() is at the moment a drop-in replacement for ether_input_mbuf() but will let us stack pseudo-driver in a nice way in order to no longer call ether_input() recursively. ok pelikan@, reyk@, blambert@, henning@
2015-02-08remove the dead code inside #if(def) RED_NOTYETHenning Brauer
if we ever do sth like RED again it almost certainly won't be RED; the code isn't even in a state to be useful as documentation/hint, and even if it was it could be retrieved from the attic.
2015-02-08pf normalization code was in dire need of style normalization.Henning Brauer
ok mpi pelikan
2015-02-07pf synproxy will do the 3WHS on behalf of the target machine, and onceHenning Brauer
the 3WHS is completed, establish the backend connection. The trigger for "3WHS completed" is the reception of the first ACK. However, we should not proceed if that ACK also has RST or FIN set. ACK+RST part pointed out by Kojedzinszky Richard <krichy at tvnetwork hu> ok mikeb dlg phessler claudio
2015-02-07make RB_PROTOTYPE usage ISO C compliant by removing useless semicolonsMartin Pelikan
fixes some compiler warnings, tested by amd64 base build ok beck
2015-02-06earlier rev 1.112 sys/net/if_vlan.c corrects the mapping of 802.1pSebastian Benoit
prio from the vlan header to our pf priority levels. This fixes the mapping in the bridge code. ok henning
2015-02-06earlier rev 1.112 sys/net/if_vlan.c corrects the mapping of 802.1pSebastian Benoit
prio from the vlan header to our pf priority levels. This fixes the mapping on the ouput path. ok henning
2015-02-06IEEE sez that 0 is bigger than 1, and IEEE is always right.Henning Brauer
When mapping 802.1p prio from the vlan header to our priority levels, we have to swap 0 and 1, since in 802.1p, 1 is the lowest prio, and 0 the 2nd lowest. But 2..7 are in the expected order! Pointed out to me at BSDcan and I forgot by whom, sorry for that and the delay. ok phessler pelikan
2015-02-06since I just touched this file and thus cause an almost full recompile ofHenning Brauer
everything in the kernel for everybody anyway, can as well use the opportunity to move the block with the IF_* macros down next to the IFQ_* versions; has always been slightly confusing - was like that due to the long gone ALTQ versions of these macros. claudio agrees.
2015-02-06g/c unused IFQ_INC_LEN, IFQ_DEC_LEN and IFQ_INC_DROPS, ok claudioHenning Brauer
2015-02-06using IFQ_INC_LEN and IFQ_DEC_LEN for len++/len-- is a bit excessive,Henning Brauer
especially given that these are the only users of these macros. ok claudio
2015-02-06style(9) nitBret Lambert
ok claudio@
2015-02-06Change rt_mpath_conflict() to not rely on an initialized rtentry whenMartin Pieuchot
checking for actual conflict. ok claudio@, henning@
2015-02-05implement SIOCIFAFATTACH and SIOCIFAFDETACH for AF_INETHenning Brauer
SIOCIFAFATTACH is a noop SIOCIFAFDETACH calls in_ifdetach(), thus removing all AF_INET addresses ok phessler theo
2015-02-05Make sure pf(4) does not see embedded scopes.Martin Pieuchot
Packets destinated to link-local addresses are looped back with embedded scopes because we cannot restore them using the receiving interface (lo0). Embedded scopes are needed by the routing table to match RTF_LOCAL routes, but pf(4) never saw them and existing rules are likely to break without teaching the rule engine about them, found by dlg@ the hard way. So save and restore embedded scopes around pf_test() for packets going through loopback. ok dlg@, mikeb@
2015-01-29back bpf.c down to 1.113, from before most recent timeout changes.Ted Unangst
nmap is broken, as reported by kent fritz. pending further investigation, we should keep nmap working until a better fix is developed for the original problem.
2015-01-28Revert rtdeletemsg conversion. It was not ok'd, I misunderstood bluhm@'sMartin Pieuchot
email.
2015-01-28when doing a blocking read with a timeout, after the sleep resetDavid Gwynne
the start time so the next read behaves the same. from Simon Mages
2015-01-27Ensure that link-local addresses are correctly configured on loopbackMartin Pieuchot
interfaces. When the kernel automagically configures IPv6 addresses on loopback interfaces, start by assigning a link-local address and then try to assign "::1". Only the first configured loopback interface per rdomain can have the "::1" address. But even if other loopback interfaces failed to get this address, because it is already taken, give them a chance to have a link-local address. While here change in6_ifattach() to return an error value and remove duplicated code. Fix a regression introduced by the NOINET6 flag removal. ok henning@, stsp@, florian@, benno@
2015-01-27Do not overwrite user-specified MTU.Martin Pieuchot
Allow to use different size than the default of 32K. ok henning@, stsp@, florian@, benno@ as part of a larger diff.
2015-01-27remove the second void * argument on tasks.David Gwynne
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
2015-01-26Do not always try to rtfree(9) route entries inside rtdeletemsg(9).Martin Pieuchot
Instead check the error code returned by this function and let the caller free the route entry when appropriate. ok bluhm@
2015-01-24Userland (base & ports) was adapted to always include <netinet/in.h>Theo de Raadt
before <net/pfvar.h> or <net/if_pflog.h>. The kernel files can be cleaned up next. Some sockaddr_union steps make it into here as well. ok naddy
2015-01-21if_media.c needs net/if_var.h. This fixes the build with IFMEDIA_DEBUG.Theo de Raadt
from Fabian Raetz