summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2007-09-09Only clear the message header if it is called from a sysctl walk. ThisClaudio Jeker
unbreaks RTM_GET. Problem reported by fkr@
2007-09-08Clear the message header (and only the message header) in rt_msg2.Claudio Jeker
By doing so we ensure that all the memory is initialised and we no longer have to ensure that none of the structure elements is forgotten in sysctl_iflist() and sysctl_dumpentry(). This solves the route flush issues seen by aanriot@ OK henning@
2007-09-08we dont need net/rndvar.h since the code that used it has been moved toDavid Gwynne
if.c.
2007-09-07Do not recalculate TCP payload length in pf_test_rule() as it hasAlexander Bluhm
been cached in pd->p_len. ok henning@ markus@
2007-09-07Check if rtm_hdrlen is smaller then the passed message or it would be possibleClaudio Jeker
to access uninitialised memory. Set dst to 0 on error, the error path tries to access dst but dst is inited later down the code. This fixes a kernel panic seen by aanriot@ OK henning@
2007-09-07use M_ZEROReyk Floeter
2007-09-06bump the copyright while touching these filesReyk Floeter
2007-09-06With a trunk(4) interface in fail over mode the trunk(4) interfaceReyk Floeter
will show input errors for packets received from any of the ports that are part of a fail over interface but are not the "master" port at the time. This fixes the problem by checking the error condition correctly. From brad at comstyle dot com
2007-09-05IPv6 support for sppp layer, based on NetBSD version.Can Erkin Acar
ok claudio@
2007-09-03Bump RTM_VERSION to 4 and start a new aera of routing in OpenBSD :)Claudio Jeker
Changes include 64bit counters instead of u_long, routing table id in the header of most messages, reserved routing priority field, added a hdrlen field to skip over the header so that binary compatibility becomes easier. A minimal backward support for old binaries is included to ease upgrades but don't expect anything more than ifconfig, route and dhclient to correctly work. OK henning@ mglocker@
2007-09-03Make use of the pfsync 'badval' and 'stale' counters instead of usingJoel Knight
'badstate' everywhere. ok henning@
2007-09-01since theHenning Brauer
MGET* macros were changed to function calls, there wasn't any need for the pool declarations and the inclusion of pool.h From: tbert <bret.lambert@gmail.com>
2007-09-01replace the machine dependant bytes-to-clicks macro by the MI ptoa()Martin Reindl
version for i386 more architectures and ctob() replacement is being worked on prodded by and ok miod
2007-08-31zap unused "pf_tag" structure.Thordur I. Bjornsson
ok henning@
2007-08-30mechanic change:Henning Brauer
there is a 1:1 mapping between direction and the tree the states get attached to. there is no need to have anything outside the state insertion/ deletion/lookup routinbes know about these internals. so just pass the direction to the lookup functions and let them pick the right tree. ok dhartmei markus
2007-08-30handle address ranges in skip step calculationDaniel Hartmeier
2007-08-30add support for address ranges ("from 10.1.2.50 - 10.1.3.75") in from/toDaniel Hartmeier
criteria. ok mcbride@
2007-08-28showing this diff is shameful...Henning Brauer
if (r != NULL && r->rtableid >= 0) - m->m_pkthdr.pf.rtableid = m->m_pkthdr.pf.rtableid; + m->m_pkthdr.pf.rtableid = r->rtableid; fortunately it is in pf_send_tcp and thus the effect is very limited, RSTs sent due to "block return(-rst)" could be routed using the main routing table instead of an alternate one specified on the block rule. spotted by Janjaap van Velthooven <janjaap@stack.nl>
2007-08-28The m_pulldown used for aligning was not copying the header,Can Erkin Acar
revert back to m_pullup2. Reported and tested by Enache Adrian additional testing by naddy@ and claudio@ ok claudio@, deraadt@
2007-08-23allow RSTs with th_seq == seqlo +- 1, reduces the amount of 'loose state'Daniel Hartmeier
messages, add 'dir=' part to 'loose state' message, ok henning@, markus@
2007-08-21don't access th_flags when it isn't available (only 8 bytes of theDaniel Hartmeier
header are required in the ICMP error). ok deraadt@, henning@
2007-08-20Align the packet after the ppp header.Can Erkin Acar
The earlier change was broken in sparc due to alignment problems. reported and tested by nady@, ok deraadt@ claudio@
2007-08-14Make sure all the packet is in one continuous mbuf.Can Erkin Acar
This is a bandaid solution, a better solution will go in post 4.2. Reported and tested by Joerg Zinke. ok claudio@, deraadt@
2007-08-07Use the length of the mbuf instead of the packet.Can Erkin Acar
When sending a protocol reject. Prevents reading past the mbuf in case the mbuf does not cover the whole packet. ok claudio@, henning@
2007-08-06Fix some "that that"s.Tom Cosgrove
ok miod@ jmc@
2007-07-30With adding ipsec tags and exporting flow filters via sysctl SADB_GETHans-Joerg Hoexer
needs to be allowed to export that information too. Thus, adjust sadb_exts_allowed_out[] accordingly. This fixes isakmpd not being able to get the in-kernel last-used-counters of SAs, which are needed for DPD. ok ho@
2007-07-25Back out the tracking of procs in struct selinfo. There's one seriousArtur Grabowski
bug in the code, but as soon as I try to fix it, it seems to trigger some other bugs. Instead of trying to figure out what's going on while everyone suffers, it's better to back out and figure out the bugs outside the tree.
2007-07-21add ETHERTYPE_PAE (802.1X Port Access Entity).Damien Bergamini
replace a dead link while i'm here. ok canacar@ reyk@
2007-07-18Don't drop outgoing packets in case of a congested input queue.Marco Pfatschbacher
OK markus@, mcbride@, "sounds reasonable" henning@
2007-07-13remove obsolete pfi_statehead and pfik_w_states; ok henning@Markus Friedl
2007-07-10adjust pf_find_state_all() so that it works correctly for the new globalKurt Miller
table/state tail queue design. corrects ftp-proxy errors "server lookup failed (no rdr?)" okay henning@
2007-07-06btintrq has been removed from bt_input.c, don't reference it here.Christian Weisgerber
Makes bluetooth build again. ok uwe@
2007-07-04Fix a use after free crash in in_delmulti(). If a interface is detachedClaudio Jeker
before it is removed from the multicast group in_delmulti() will try to access the no longer available ifp. We invalidate the ifa_ifp back pointer in the ifa in if_detach() now and use the ifa_ifp in in_delmulti() instead of the internal inm_ifp. By doing it this way we know if the interface was removed. This fixes a kernel panic triggered by ospfd and gif(4) tunnels. looks good henning@ reyk@
2007-07-04No m_copyback for ICMP and "other" protocols on rdr/binat.Marco Pfatschbacher
Fixes ICMP packet payload corruption on rdr. OK henning@, markus@
2007-06-26Fix a race condition during ruleset reload; make sure we don't walk offRyan Thomas McBride
the end of the array of rule pointers when attaching a pfsync'd state to a rule. Reported in PR5508 by mayer@netlab.nec.de. ok henning@
2007-06-25crank ifq_maxlen from 50 to 256, so it is not smaller than most interfacesHenning Brauer
rx rings any more. forwarding boxes with many fast interfaces can still use some more, but this is a saner default. ok deraadt markus henric
2007-06-25pretty mechanical change: now that the state tables use seperate stateHenning Brauer
keys that can map to multiple states (last not least for ifbound) we don't need state tables hanging off each struct kif representing an interface any more. use two globals for the two tables. ok markus ryan
2007-06-24Save some bytes and make code more readable by removing junk union andRyan Thomas McBride
unused ifname (this information is in struct pf_state_sync now). Also a bit of KNF on the pf_state struct. ok mpf@ henning@
2007-06-22export the flow/filter information attached to the SA, too; ok hshoexer@Markus Friedl
2007-06-21force logif to zero if no logging is asked forHenning Brauer
check the logif when changing a rule from max laier, ok ryan
2007-06-21reimplement interface bound states in a non-retarded way.Henning Brauer
previously, we had a set of state tables attached to each interface. so for every packet we had to do a lookup in the tables for the interface, and afterwards in the global tables. since we split state keys and states now, use only the global tables, and put the actual states in a tail queue attached to the state key. sort the list so that ifbound states come before global ones. on lookup, we only have to compare the interface pointer on the actual states and use the first one where either the interface matches or the state is not interface bound. thus, if you don't actually use ifbound states, and there is only one state per state key, the overhead is close to zero, where we had extra lookups before. in addition to a much cleaner design (that'll allow for more goodies later) this gives us ~12.5% more forwarding performance. mostly hacked at c2k7, lots of help, testing and ok mcbride & markus
2007-06-20Allow "log" for nat rules without "pass".Marco Pfatschbacher
OK henning@, ``passt scho'' markus@
2007-06-17add back missing bcopy & break, got lost when removing arcnet.Henning Brauer
spotted by Mike Belopuhov <mkb@crypt.org.ru>
2007-06-15in pf_test_rule, before handling IPPROTO_ICMP / IPPROTO_ICMPV6, check thatHenning Brauer
the packet is of the expected address family (AF_INET / AF_INET6). crafted IPv4 packets with IPPROTO_ICMPV6 can make us crash otherwise. misbehaviour provoked by Adrian Close <adrian@close.wattle.id.au> playing with nmap; he also helped us big time debugging the problem. thanks! ok ryan
2007-06-14Add a new "rtlabel" option to ifconfig. It allows to specify a route labelReyk Floeter
which will be used for new interface routes. For example, ifconfig em0 10.1.1.0 255.255.255.0 rtlabel RING_1 will set the new interface address and attach the route label RING_1 to the corresponding route. manpage bits from jmc@ ok claudio@ henning@
2007-06-14sprinkle some #ifdef IPSEC so that pfsync compiles w/o ipsecHenning Brauer
from mickey, ok me markus mickey
2007-06-11move definitions for the flags in the mbuf header used by pf to mbuf.hHenning Brauer
since we include the mbuf header parts for pf unconditionally, we should be able to check them unconditionally as well. ok mcbride markus
2007-06-09fix wrong argument passing to m_copyback for the log caseHenning Brauer
(&ptr instead of ptr). should fix pflog breakage seen by bob
2007-06-09sizeof(ptr) is no good if you want sizeof(*ptr). icmp/icmpv6.Henning Brauer
2007-06-08kill arcnet leftovers, some pt out by Mike Belopuhov <mkb@crypt.org.ru>,Henning Brauer
some I found afterwards, ok dlg