summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2003-07-03unused global. dhartmei okJun-ichiro itojun Hagino
2003-07-01wrap pf_normalize_ip6() by #ifdef INET6. pointed out by Wouter ClarieJun-ichiro itojun Hagino
2003-06-30change that queue ID allocator so it always has the queues sorted by ID.Henning Brauer
that allows us to get rid of the "tagid" global which stored the highest tag ID in use. when allocating a new ID scan the list for a free slot and only use highest + 1 on failure instead of using highest + 1 from the beginning scanning for a dup afterwards. this prevents ID space fragmentation better. as a result this allows us do get rid of the pf_tag_purge() function completely and let pf_tag_unref() remove an entry once the reference counter reaches zero by itself. after all it makes for easier code and is about 50% faster. idea came up during a discussion on icb earlier today between cedric and myself, which itself was particulary inspired by Darren Reed questioning the need for pf_tag_purge on tech-net@netbsd. ok dhartmei@ cedric@
2003-06-30reset interface statistics when loginterface is changed, closes pr3332,Daniel Hartmeier
from Jason Ackley, ok henning@, cedric@
2003-06-30missing pf_tag_purge()Henning Brauer
cedric made me check
2003-06-30move prototype for pf_tag_purge() to pfvar.hHenning Brauer
2003-06-29normalize IPv6 packet (no reass, but it is a start). dhartmei & henning okJun-ichiro itojun Hagino
- length, jumbo payload option - TTL ("hoplimit" in IPv6 terminology) rewrite
2003-06-29unused global. dhartmei okJun-ichiro itojun Hagino
2003-06-28redundant (pfvar.h already have it)Jun-ichiro itojun Hagino
2003-06-28remove duplicated prototype (they are in pfvar.h). dhartmei okJun-ichiro itojun Hagino
2003-06-27protos for userland buildTheo de Raadt
2003-06-27do pf_tagname2tag() in DIOCCHANGERULE as well.Henning Brauer
noticed by and ok cedric@
2003-06-27move down pf_tag_unref() calls in pf_rm_rule() to after the check wetehr thereHenning Brauer
are still states for the given rule existant. based on a very nice analysis from cedric@, that is so completely right that I have nothing to add: in pf_rm_rule(), the pf_tag_unref() calls are done *before* the if (rule->states > 0 || rule->entries.tqe_prev != NULL) test. That mean that the two pf_tag_unref() calls could occur *twice* for a given rule: first when the rule is removed from the ruleset and (if the rule was kept around because of a state) a second time when the state refcount drops to zero and the rule gets really deleted. Unless I'm mistaken, that breaks the refcounting. ...and cedric was not mistaken. and, as daniel pointed out: The breakage this causes is so subtle, I doubt anyone noticed it before, if it did occur. consensus on this between cedric, dhartmei and myself
2003-06-25add a pf_tagname field to ifbrlreq and a pf_tag field to ifbrlnode.Henning Brauer
on bridge rule load translate tagnames to pf tags using pf_tagname2tag etc if packets match a bridge filter rule tag them using pf_tag_packet() with the given tag help dhartmei@ ok deraadt@ jason@ dhartmei@
2003-06-24in the ipv6 case, allow route-to to route to link-local addressesHenning Brauer
from KOZUKA Masahiro <ma-kun@kozuka.jp> with a minor adjustment from itojun ok itojun@ dhartmei@
2003-06-24KNFHenning Brauer
2003-06-24recover code that requires exact match on rtm_change/lock (lost in netbsd 1.16).Jun-ichiro itojun Hagino
without it "route change X" would change less-specific route by mistake. reported by jinmei@kame, markus ok
2003-06-23Don't remove anchor too early in table code, it makes PF use freed memory.Cedric Berger
This might just be a temporary fix, we're still looking for a better one. ok dhartmei@
2003-06-21count packets and bidirectionally on state entries, allowing for fine-grainedDamien Miller
traffic reporting w/ pfsync; ok dhartmei@ Note: ABI change (new fields in struct pf_state), requires a rebuild of pfctl and tcpdump.
2003-06-20Add MSS support to the synproxy. The client's MSS is sent to the server,Daniel Hartmeier
the server's MSS is guessed based on the routing table and interface MTU. Fine patch entirely from Krists Krilovs <pow@pow.za.net>, ok frantzen@ Note: ABI change (new field in struct pf_state), requires a pfctl rebuild (and tcpdump for pfsync).
2003-06-20Extend 'BAD ICMP' debug message, include icmp type/code and outer IP headerDaniel Hartmeier
addresses. ok mcbride@, cedric@
2003-06-18Do not panic on no memory available when allocating bufs, pass ENOBUFSHenning Brauer
to userland instead. fixes PRs 2235, 2236 and 2640 from Otto Moerbeek <otto@drijf.net> ok frantzen@, tedu@, deraadt@
2003-06-14Use source's window scaling factor (instead of destination's) whenDaniel Hartmeier
comparing ackskew, otherwise legitimate low acks can get blocked. Was triggered when asymmetric scale factors where used in combination with SACK. Report and logs provided by Peter Galbavy. ok frantzen@, henning@
2003-06-12in FIONREAD and FREAD, use IFQ_POLL instead of looking at if_snd.ifq_len /Henning Brauer
ifq_head, to make altq work. prevents programs from spinning in non-blocking select()/read() loops in case of queues hitting their limits. This makes queueing on tun interfaces work. while it is still advised to assign packets to queues on tunX and queue on the physical interface in generic, this doesn't work in the PPPoE case with the userland pppoe process, there the mbuf tags with the queue IDs don't survive obviously. based on diff from Trevor Talbot, tested successfully by a lot of people on the pf@benzedrine.cx list. ok pb@ kjc@
2003-06-10It would kind of help if the flags member was initialized, otherwise randomDaniel Hartmeier
rules create state. Truly hard to spot. Unless you run the code, of course.
2003-06-09Attempt to resolve byte order confusion in nat code once and for all.Ryan Thomas McBride
- pf_get_sport() leaves the translated port in the packet in network byte order - merge code for the p1=0 p2=0 case and static-port case in pr_get_sport() NOTE: people who use the static-port keyword in their pf.conf need to make sure pfctl is updated along with their kernel.
2003-06-08Returns the correct array size.Cedric Berger
2003-06-08A table in an anchor creates a real anchor: pfctl -sA works.Cedric Berger
The following two pfctl functions work with an "-a" option: - pfctl [-a foo[:bar]] -sT - pfctl [-a foo[:bar]] -FT ok dhartmei@
2003-06-03move some prototypes to pfvar.h. needed soon.Henning Brauer
pf_tagname2tag, pf_tag2tagname, pf_tag_unref, pf_tag_packet
2003-06-03provide pf_tag2tagname which is the reverse of pf_tagname2tag. needed soon.Henning Brauer
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-06-02nuke clause 3 & 4Jason Wright
2003-05-30KNF & ANSI, jason agreesHenning Brauer
2003-05-30o the timeout is int, not u_int32_tHenning Brauer
o check timeout for negative values and overflow ok tedu@ jason@
2003-05-24Unused variable.Cedric Berger
2003-05-18speed hack: delay fetching the mbuf tag until we really need it (hit aHenning Brauer
"tagged X" rule), and only get it when we really need it. simplifies code too. ok dhartmei@ pb@
2003-05-18Merge pf_send_ack() and _send_syn() into a generic _send_tcp().Daniel Hartmeier
In the SYN proxy, generate ACKs with proper window sizes after the handshakes.
2003-05-17Correct two comment typos.Daniel Hartmeier
2003-05-17With rdr we want the source IP from the packet, not the source IP fromRyan Thomas McBride
the rule. Fixes rdr with address pools using bitmask and source-hash address selection methods. ok dhartmei@ henning@
2003-05-17allow inverse matching on tagsHenning Brauer
ok dhartmei@ pb@
2003-05-17Add an 'action' code that allows the SYN proxy to swallow/drop a packetDaniel Hartmeier
without causing EHOSTUNREACH to be delivered to local sockets, so it works for outgoing connections originating on the same host. ok frantzen@
2003-05-16TCP SYN proxy. Instead of 'keep state' or 'modulate state', one can useDaniel Hartmeier
'synproxy state' for TCP connections. pf will complete the TCP handshake with the active endpoint before passing any packets to the passive end- point, preventing spoofed SYN floods from reaching the passive endpoint. No additional memory requirements, no cookies needed, random initial sequence numbers, uses the existing sequence number modulators to translate packets after the handshakes. ok frantzen@
2003-05-14- modulate TCP Timestamps so they can't be used to detect NAT and to precludeMike Frantzen
remote uptime determination - scrub modifier "reassemble tcp" turns on stateful TCP normalizations ok henning@ dhartmei@
2003-05-14tag on each matching rule, not just the last one.Henning Brauer
idea from theo. to speed that up the real mbuf tag is not written until we hit the last match but an internal variable is used to track the tag. this can be used to split classification and policy enforcement, for example. and much much much more... ok dhartmei@ frantzen@
2003-05-14unifdef __FreeBSD__ and stuff. markus okJun-ichiro itojun Hagino
2003-05-14Use official (from pcap people) link type for pflog.Can Erkin Acar
With this change, the log header format also changes. The new log format is extendible and allows logging of the originating anchor and ruleset information. ok henning@ dhartmei@ frantzen@
2003-05-142 lines of code bring us tags on nat rulesHenning Brauer
ok dhartmei@ frantzen@
2003-05-14move ETHERTYPE_xx declarations to <net/ethertypes.h>. meets netbsd practice.Jun-ichiro itojun Hagino
deraadt ok
2003-05-14fix use after free race when purging the new PF tagsMike Frantzen
ok henning@
2003-05-13add support for tagging packets with arbitary tags and filtering based onHenning Brauer
those tags later on. ok dhartmei@ pb@ mcbride@ frantzen@