summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2008-06-14add carppeer; an option to specify a different multicast address orReyk Floeter
even the unicast address of the remote carp peer. this especially helps when the multicast carp advertisements are causing problems in the network (some crappy switches don't do well with multicast), there are conflicts with VRRP, or the policy of the network does not allow multicast (most Internet eXchange points didn't allow carped OpenBGP routers because of the multicast advertisements). discussed with many ok mpf@
2008-06-14Remove NBPFILTER conditional since we do not include "bpfilter.h" and theJoel Sing
<net/bpf.h> header is not required here. ok henning@
2008-06-14Include "pflog.h" so that we get NPFLOG.Joel Sing
ok henning@
2008-06-14Also do the PR_ZERO dance here. This was held back on Henning's requestMichael Knudsen
because it conflicted with the change he did in pf_if.c earlier. He finally woke up to ok (well, ``yes'', really) this version now.
2008-06-14There's no more reason to use oldnointr allocator here since we paceArtur Grabowski
the allocations in uvm_km_thread, as long as they are PR_WAITOK and all the memory hogs should be WAITOK in pf now. "following your explaination, it's ok" henning@
2008-06-14pool_get()s not in interrupt context should not be PR_NOWAIT, butHenning Brauer
PR_WAITOK | PR_LIMITFAIL. from discussion with art. ok ryan claudio thib
2008-06-14Move bpf_mtap_hdr() above the trunk_*_input() routines.Marco Pfatschbacher
This makes it easier to add trunk protocols that consume some packets. Add a special case for the failover protocol, to prevent shoving duplicates to bpf. (Not beautiful, but it has to do for the moment). OK reyk@, claudio@
2008-06-13Move the responsibility to free received packets on trunked interfacesMarco Pfatschbacher
from ether_input() into trunk_input() where it can be handled in a smarter way. OK claudio@ and reyk@ on an earlier version.
2008-06-13Change the logic when selecting routes on RTM_CHANGE & RTM_GET. RTM_CHANGEClaudio Jeker
can not supply the correct nexthop if the nexthop is changed. So if the route we want to change is a non-multipath one allow the change to succeed. This unbreaks RTM_CHANGE in most situations. Found by jsing@ Ok henning@
2008-06-13we used to use the lowest (so it is deterministic) mac address in theHenning Brauer
system for the bridge ID for stp. That worksfine unless you have two bridges in the system that talkto the same neighboring systems (switches), because the two bridges on the openbsd system would have the same ID. fix by only looking at interfaces part of the bridge and using the lowest mac address of these. works fine because stpcan only be enabled on IFT_ETHER interfaces so there is always at least one and we re-evaluate every time an interface is added or deleted from the bridge. diff was rotting in my tree for at least a year, I have no idea what triggered it really. ok reyk mk djm
2008-06-13Treat LINK_STATE_UNKNOWN as LINK_STATE_UP.Marco Pfatschbacher
This restores the old behaviour where we were checking for != LINK_STATE_DOWN. Fixes the ethernet to wireless failover feature and also allows trunk(4) to be used within qemu. Tested by sturm@. OK reyk@. "grumble, we should fix more drivers' link state handling" brad@
2008-06-13Cleanup a bit. Instead of doing dst = 0 in every error handling block initClaudio Jeker
it once at start instead.
2008-06-12fix synproxy.Henning Brauer
the factored out pf_create_state() could return PF_PASS, _DROP, and _SYNPROXY_DROP. We were treating the latter the same as _PASS and thus passing the original SYN which we of course don't want in the synproxy case. breakage reported by sakurai-san, headscratching with and ok ryan
2008-06-12#if 0 an annoygly chatty printf active whenever we're at loglevelHenning Brauer
loud, spilling out hundreds of lines on ruleset reloads is disturbing when you're hacking over cereal console, ryan ok
2008-06-12Fix the egress group matching for IPv4. There are to ways to define a /0Claudio Jeker
network mask. For some reasons some parts set sa->sa_len to 0 to specify a /0 netmask so check fot that too. tested by david@ OK henning@
2008-06-11Split address setup operations into a separate function. More to come.Ryan Thomas McBride
ok henning
2008-06-11when we establish the mapping from a state key, do it both ways, akaHenning Brauer
key1->reverse = key2; and key2->reverse = key1; ok ryan
2008-06-11factor out state creation code for readability; make it static inlineHenning Brauer
to not hurt performance while passing the 20 args (sigh) ok theo ryan, ok + feedback jsing
2008-06-11superfluous to check for m != NULL in pf_find_state, it is plainHenning Brauer
impossible that m is NULL here since all callers dereference it unconditionally beforehands, and find state without and mbuf doesn't make sense in the first place
2008-06-11after finding a state in the outbound path clear the statekey pointerHenning Brauer
in the header so it cannot get used again in case of somewhat weird reflection + mbuf-reuse-without-pkthdr-clearing cases. it looks like gif falls into the latter category. discussed with and ok theo
2008-06-11extra paranoia:Henning Brauer
1) only set the state key in the mbuf header in the inbound case 2) only use it in the outbound case discussed with and ok theo
2008-06-11yuck, fix a last minute collisionHenning Brauer
2008-06-11store a pointer to the stack side state key in the mbuf packetHenning Brauer
header inbound. on the outbound side, we take that and look for the key that is the exact opposite, and store that mapping in the state key. on subsequent packets we don't have to do the lookup on outbound any more. almost unable to get real benchmarks going here, we know for sure this gives a more than 5% increase in forwarding performance. many thanks to ckuethe for stress- and performance-testing. ok ryan theo
2008-06-10Handle the closing of half connections where we don't see the fullReyk Floeter
bidirectional FIN/ACK+ACK handshake. ok henning@
2008-06-10Simplify code slightly; use PR_ZERO with pool_get() rather than bzero().Ryan Thomas McBride
ok mpf henning
2008-06-10Free the counters struct when we free the table entry.Ryan Thomas McBride
2008-06-10Handle a special sloppy case where we only see one half of theReyk Floeter
connection. If there is a ACK after the initial SYN without ever seeing a packet from the destination, set the connection to established. ok henning@
2008-06-10Make counters on table addresses optional and disabled by default.Ryan Thomas McBride
Use the 'counters' table option in pf.conf if you actually need them. If enabled, memory is not allocated until packets match an address. This saves about 40% memory if counters are not being used, and paves the way for some more significant cleanups coming soon. ok henning mpf deraadt
2008-06-10when walking the entire state table it makes much more sense to walkHenning Brauer
the tailq instead of the rb tree. pt out by kjell some time ago, ok ryan
2008-06-10remove a debug check& printf that should not have gone in in the firstHenning Brauer
place
2008-06-10save somespace in the state by collapsing two 8 bit ints used as booleansHenning Brauer
into one 8 bit flags field. shrinks the state structure by 4 bytes on 32bit archs ryan ok
2008-06-10in pf_test_state_icmp when trying tomatch icmp errors to tcp sessionsHenning Brauer
do not verify the sequence number against the state if the state is sloppy and thus doesn't have that information. independently pointed out by frantzen and ryan, ok ryan
2008-06-10implement a sloppy tcpstate tracker which does not look at sequenceHenning Brauer
numbers at all. scary consequences; only tobe used in very specific situations where you don't see all packets of a connection, e. g. asymmetric routing. ok ryan reyk theo
2008-06-09rename arc4random_bytes => arc4random_buf to match libc's nicer name;Damien Miller
ok deraadt@
2008-06-08factor out the tcp sequence number tracking from pf_test_state_tcpHenning Brauer
ok mcbride
2008-06-08The default route is 0.0.0.0/0 so it is necessary to check the mask as well.Claudio Jeker
OK henning@
2008-06-08First minimal cleanup of routing code, kill rtrequest() it got replaced withClaudio Jeker
rtrequest1() everywhere now. OK henning@
2008-06-08Use m_freem() instead of m_free() in trunk_start() to ensure that theBrad Smith
full mbuf chain is being free'd. ok reyk@
2008-06-08null pointer check before derefHenning Brauer
almost nobody ran into that because it is ipv6 only
2008-06-08Don't spam dmesg with sppp messages, instead use log(9).Claudio Jeker
OK canacar@ some time ago
2008-06-02Fix synproxy breakage introduced with the state table reorganization.Ryan Thomas McBride
Bug report and testing from Otto Bretz. ok henning@
2008-05-30trivial KNF before we go furtherHenning Brauer
2008-05-29Second half of PF state table rearrangement.Ryan Thomas McBride
- Mechanical change: Use arrays for state key pointers in pf_state, and addr/port in pf_state_key, to allow the use of indexes. - Fix NAT, pfsync, pfctl, and tcpdump to handle the new state structures. In struct pfsync_state, both state keys are included even when identical. - Also fix some bugs discovered in the existing code during testing. (in particular, "block return" for TCP packets was not returning an RST) ok henning beck deraadt tested by otto dlg beck laurent Special thanks to users Manuel Pata and Emilio Perea who did enough testing to actually find some bugs.
2008-05-29rewrite the state table logic.Henning Brauer
complete the split off of the layer 3/4 adressing information from the extra information in the actual state. a state key holds a list of states, and a state points to two state keys - they're only different in the NAT case. More specificially, it deprecates the (often difficult to understand) concept of lan, ext, and gwy addresses, replacing them with WIRE and STACK side address tuples. (af, proto, saddr, daddr, sport, dport). Concept first brought up some years ago on a ferry ride in bc by ryan and me, I spent some time over the last year getting closer, and finally got it completed in japan with ryan. dlg also took part, helped a lot, and saved us 8 bytes. This commit removes support for any kind of NAT as well as pfsync. It also paves the road for some code simplification and some very cool future stuff. ok ryan beck, tested by many
2008-05-23Deal with the situation when TCP nfs mounts timeout and processesThordur I. Bjornsson
get hung in nfs_reconnect() because they do not have the proper privilages to bind to a socket, by adding a struct proc * argument to sobind() (and the *_usrreq() routines, and finally in{6}_pcbbind) and do the sobind() with proc0 in nfs_connect. OK markus@, blambert@. "go ahead" deraadt@. Fixes an issue reported by bernd@ (Tested by bernd@). Fixes PR5135 too.
2008-05-21Only cancel (timeout_del()) the timeout if we're not going to delay itMichael Knudsen
(timeout_add()) anyway. ok brad claudio
2008-05-21Just clear the timeout since timeout_del() can cope withMichael Knudsen
unscheduled/already triggered timeouts. ok brad claudio
2008-05-18KNFRyan Thomas McBride
2008-05-17Initialize the timeouts only once instead of everytime they are startedCan Erkin Acar
Prevents hangs as reported and tested by James Stark, PR:5795, ok henning@
2008-05-15divert for ipv6; ok henning, pyrMarkus Friedl