summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2010-01-18Convert pf debug logging to using log()/addlog(), a single standardisedRyan Thomas McBride
definition of DPFPRINTF(), and log priorities from syslog.h. Old debug levels will still work for now, but will eventually be phased out. discussed with henning, ok dlg
2010-01-14henning and I are both dumbasses, testing &foo against NULL is pointless.Ryan Thomas McBride
ok claudio
2010-01-14When printing states in debug output, print the rule number that createdRyan Thomas McBride
it if we have it. Requested by dlg, ok henning.
2010-01-14i forgot to remove a now obsolete comment in pf_create_state aboutHenning Brauer
incorrect error handling
2010-01-14in pf_create_state, when we fixed the leaks, we were a bit too triggerHenning Brauer
happy and went to use after free instead. ryan and I think we found the reason - just freeing that state keys in the error path is wrong as well, since pf_state_key_setup could have found existing, identical state keys and linked our state to these. if we now free them the other state that hung of these state keys would point back to the freed state keys. so instead of manually trying to free the state keys just call pf_state_key_detach which has all the magic checks. with and ok ryan
2010-01-13in pf_state_key_detach, ensure that the state key pointer on the stateHenning Brauer
is not null, to be safe and to be able to call this with half setup states. with and ok ryan
2010-01-13cleanup pipex code. ok henning@YASUOKA Masahiko
2010-01-13replace static on functions with Static so openbsd can define it awayDavid Gwynne
to nothing. this lets us see functions in ddb, while not hurting the ability to share the code with other projects. idea borrowed from the usb stack. ok yasuoka@
2010-01-13Preliminary rdomain support in bridge(4). Make sure that m->m_pkthdr.rdomainClaudio Jeker
is set whenever we changing the rcvif. It is still not possible to pass traffic between two vether but works now form outside. OK deraadt@
2010-01-13make ifa_ifwithaddr use the shiny new ifaddr RB tree instead of traversingHenning Brauer
the list of all interfaces and traversing the list of all addresses on each interface. if bugs show up with addressing this is the #1 backout candidate, something i missed might fuck with ifaddrs behind our back, although i looked & tested hard. 10x to naddy for inet6 testing. ok theo ryan dlg
2010-01-13maintain a global RB tree of all local addresses in the system. thisHenning Brauer
includes AF_LINK addresses (aka mac addresses in the ethernet case). for inet this also includes the broadcast addresses. depends on ifinit() called earlier so we have a chance to pool_init before autoconf assigns the AF_LINK addresses, the v6 fix, and the ifa_add/del abstraction i just committed. this is a change in semantics, it is now illegal to change the actual address in an ifaddr struct because then the RB tree becomes unbalanced. nothing using this tree yet. ok theo ryan dlg
2010-01-13instead of fiddling with the per-interface address lists directly inHenning Brauer
many places create a proper API (ifa_add / ifa_del) and use it. ok theo ryan dlg
2010-01-13Remove extern reference to pf_pabuf which uses a structJonathan Gray
which no longer exists. Makes gcc4 kernels compile again. ok henning@
2010-01-12factor m_pulldown out of the message handlers up into pfsync_input nowDavid Gwynne
that it knows how big the messages are. rework the message handlers to use the pfsync_subheader.len value to iterate over the message regions. deprecate the EOF subheader since trying to pulldown a 0 byte buffer is fail. ok mcbride@ sperreault@
2010-01-12delete more left-over stuff from vether developmentTheo de Raadt
2010-01-12the bridge does bpf for us, so we do not need bpf.hTheo de Raadt
2010-01-12delete the unused debug macrosTheo de Raadt
2010-01-12do not need rndvar.h anymoreTheo de Raadt
2010-01-12check the new pfsync_subheader len field on input.David Gwynne
this makes sure there is enough of the message to try and parse it, and allows implementations to skip past regions prefixed by unknown subheaders. based on discussion with mcbride@ deraadt@ and simon perreault
2010-01-12After calling pipex_pppoe_input(), we must goto done to restore the spl.YASUOKA Masahiko
ok mcbride@
2010-01-12Remove simple_unlock() that is mistakenly introduced and add requiredYASUOKA Masahiko
splx().
2010-01-12Move initialization of the MCLGETI ticker to mbinit(), instead of ifinit()Theo de Raadt
ok henning
2010-01-12Unify the various fake ethernet generators as ether_fakeaddr() whichTheo de Raadt
is safe for both hardware devices and virtual devices ok mpf, kettenis, moaning and groaning and slow acceptance from mcbride XXX should loop checking for uniqueness after new henning diff goes in
2010-01-12First pass at removing the 'pf_pool' mechanism for translation and routingRyan Thomas McBride
actions. Allow interfaces to be specified in special table entries for the routing actions. Lists of addresses can now only be done using tables, which pfctl will generate automatically from the existing syntax. Functionally, this deprecates the use of multiple tables or dynamic interfaces in a single nat or rdr rule. ok henning dlg claudio
2010-01-12Remove bpfdetach() call right in front of the if_detach() call sinceClaudio Jeker
bpfdetach() will be called in if_detach(). Diff by Gleydson Soares
2010-01-12Delete unused structures. Pointed out by deraadt@.YASUOKA Masahiko
ok mcbride@
2010-01-12fix ioctl number that conflicted with tun(4)'s ioctl number.YASUOKA Masahiko
ok mcbride@
2010-01-12set the length of the send queue to 1.David Gwynne
this prevents the ultimate length of the queue of the underlying interface from being artificially inflated while hte vlan/trunk queue is filled and then dumped wholesale on the underlying interface, which will dump its massive queue wholesale on the chip. tx mitigation is only triggered on real interfaces now (which is where the cost is) ok beck@ original diff ok kjc@ henning@
2010-01-12Make the structures for ifa_msghdr and friends even more likeTheo de Raadt
the route messages so that people and compilers will not get confused. ok claudio
2010-01-11"final" leak in state creation: in pf_state_key_setup, if we actuallyHenning Brauer
need two state keys (NAT case), and we succeed allocating the first one but fail getting the second we'd leak the first one. obvious and thus ok'd by dlg ryan and theo within seconds
2010-01-11fix a bug in pf_create_state that was a major source of amusement for meHenning Brauer
over the last couple of weeks (ever since I found it): when we are out of memory for the state keys we leak the state. oh the irony. instead of just fixing that one case rework the error handling in the entire function. verified painfully by yours truly by forcefully exercising each and every error path in there. ryan ok
2010-01-11Initial import PIPEX. PIPEX(Pppac IP EXtension) is a IP forwardingYASUOKA Masahiko
acceleration for PPP access concentrator. ok mcbride@ dlg@ deraadt@ reyk@.
2010-01-11remove some debug code that snuck in somehow.David Gwynne
2010-01-10replace a pad in the pfsync subheader with a length field. it stores theDavid Gwynne
length of its message in dwords. multiply that by the count of the messages to figure out how to skip to the next subheader. "old" code still thinks the len field is a pad, which it doesnt look at, so new messages with a filled in len are still parsed correctly by "old" code. input and ok mcbride@ sounds good! Simon Perreault
2010-01-09No need to call bpfdetach() in mpe_clone_destroy() since this is done inClaudio Jeker
if_detach() which is called right afterwards. Found by Gleydson Soares (gleydson (at) trusted.com.br)
2010-01-08During "ifconfig $if -inet6" remove v6 addresses even if theStefan Sperling
interface is marked down, and wrap interface detach/attach in splnet(). ok henning@ todd@, "I like the idea" deraadt@
2009-12-26Initial rdomain support for mpe(4). Caveat: assumes MPLS is always inClaudio Jeker
rdomain 0 for now. OK michele@
2009-12-24add support to pf for filtering a packet by the interface it was receivedDavid Gwynne
on. use the received-on IFNAME filter option on a pf.conf rule to restrict which packet the interface had to be received on. eg: pass out on em0 from $foo to $bar received-on fxp0 ive been running this in production for a week now. i find it particularly usefull with interface groups. no objections, and a few "i like"s from henning, claudio, deraadt, mpf
2009-12-14fix sticky-address - by pretty much re-implementing it. still followingHenning Brauer
the original approach using a source tracking node. the reimplementation i smore flexible than the original one, we now have an slist of source tracking nodes per state. that is cheap because more than one entry will be an absolute exception. ok beck and jsg, also stress tested by Sebastian Benoit <benoit-lists at fb12.de>
2009-12-13Ensure that if_start() is called at IPL_NET.Joel Sing
ok claudio@
2009-12-08move "pf: key search" and "pf: key setup" messages to PF_DEBUG_NOISYStuart Henderson
instead of MISC. "makes a little bit more sense" henning@
2009-12-03fix order dependency of pfsync interface setup, with claudio;Otto Moerbeek
ok claudio@ dlg@
2009-11-26magical fix for a fault which reliably brings my firewalls down. i thinkDavid Gwynne
not having sks and sks set to NULL causes random memory to be pool_put(). ok deraadt@ jsing@
2009-11-24kill obsolete natpassHenning Brauer
2009-11-23with the old code we initialized the state keys early in some casesHenning Brauer
and thus had to get rid of them if we didn't create state. this is no longer the case, kill dead code. ok claudio
2009-11-23one kinda-missing log |= PFLOG_FORCE in the v6 case, spotted by claudioHenning Brauer
2009-11-23sync the handling of the log flag from pf_test (where it is correct)Henning Brauer
to pf_test6 (where it is wrong in some edge cases, for match rules and logs a packet twice in some cases). ok claudio
2009-11-23pf_test_fragment: we need to bail out if action == PF_DROP, notHenning Brauer
if action != PF_PASS. same was changed in pf_test_rule a while back but the fragment case was forgotten. since everybody reassembles nobody ran into this.
2009-11-23sync some comments with realityHenning Brauer
2009-11-23remove the nat_rule pointer on pf_state and pf_pdesc, obsolete afterHenning Brauer
the NAT rewrite and ever since then only checked in a couple of plaes but never set. same for nat_src_node on pf_state. with this the NAT rewrite made pf over 1000 lines shorter.