summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
AgeCommit message (Collapse)Author
2008-09-29fix log option with filter rulesReyk Floeter
2008-09-29also log the label if available for the matching rule node (like theReyk Floeter
URL filter category etc.)
2008-09-29spacingReyk Floeter
2008-09-29Change parsing of comments in external rule files. The hash mark mayReyk Floeter
appear in URLs (eg. /index.html#anchor), so only allow full-line comments indicated by a hash mark # at the beginning of a line.
2008-09-29allow to load expect, filter, log, and remove keys from external filesReyk Floeter
just containing on key per line. this allows easier use of URL white/blacklists from external sources.
2008-09-29sort tokens for better readabilityReyk Floeter
2008-09-29allow to listen on a port range for redirections. this fixesReyk Floeter
stickyness with web applications that cannot do the clustering on their own and require stickyness with HTTP to HTTPS migration. this is required in many cases; it is a true fact that we cannot always fix the backend application in the real world. Tested and requested by many
2008-09-03Missing breaks.Jonathan Gray
ok pyr@
2008-08-11more goto fail on gettimeofday errorReyk Floeter
2008-08-11better handling of HTTP POSTs or requests with Content-Length.Reyk Floeter
2008-08-11add missing 'break' to read HTTP content correctlyReyk Floeter
2008-08-08add a variable $SERVER_NAME which is "OpenBSD relayd" by default.Reyk Floeter
2008-08-08chunked encoding may include empty lines at random places, do notReyk Floeter
abort the session if we get an empty line except of the expected chunk header.
2008-08-08fix possible memleaks in chunked encoding handlerReyk Floeter
2008-08-08only dump all protocol nodes with DEBUG > 1.Reyk Floeter
2008-08-08Support HTTP responses that neither specify a Content-Length headerReyk Floeter
nor chunked encoding. We don't know the length of the HTTP body in this case, so it only works for single-pass HTTP responses without subsequent HTTP response headers in the stream. You can still enforce the Content-Length header with an "expect" rule. For example, this fixes response handling from undeadly.org (thttpd) if relayd is running as a transparent HTTP proxy.
2008-08-08Check gettimeofday() against -1; Add a missing error check in one place.Thordur I. Bjornsson
OK reyk@
2008-07-25doc fix; from David HiggsJason McIntyre
2008-07-23validate packet length in debug dns packet logging before printing the header.Reyk Floeter
2008-07-22Add dynamic IPv6-to-IPv4 and IPv4-to-IPv6 translation inspired byReyk Floeter
faithd(8) by doing a similar mapping of IPv4/6 addresses with relayd(8) and pf(4) redirections without the need of the faith(4) interface. The trick works in both directions, it can accept IPv6 connections and relay them to IPv4 hosts by extracting the last 4 octets from the IPv6 destination (like faithd(8)), and it can accept IPv4 connections and relay them to IPv6 hosts by prepending the 4 octets of the original IPv4 destination to a configured IPv6 prefix. An access list is not needed because the classification is done in pf.conf(5). It helps to get more faith in relayd. manpage bits ok jmc@ yes, sounds good todd@
2008-07-19minor wording tweaks;Jason McIntyre
2008-07-19no need for using a TAILQ queue for the host children list, use aReyk Floeter
singly-linked SLIST instead. the only noticeable change is the reversed order to notify the children but it does not really matter here. also only walk through the children host list if the host itself is a potential parent.
2008-07-19If the new 'parent' keyword is specified for a host in a table,Reyk Floeter
inherit the state from another host with the specified Id; no additional check will be for the inheriting host. This helps in scenarios with lots of IP aliases that all point to the same service on the same host (like web hosting with many SSL domains). discussed with pyr, tested in different setups
2008-07-18terminate the input buffer on failure in print_host()Reyk Floeter
2008-07-17final reorder diff to use TAILQ_INSERT_TAIL instead ofReyk Floeter
TAILQ_INSERT_HEAD. now tables and relays are also matching the order in the config file. ok pyr@
2008-07-17add the hosts in order to get host ids that match the order in the config ↵Reyk Floeter
file. ok pyr@
2008-07-17give sane ids to hosts, tables, redirections, relays, etc. - startReyk Floeter
counting at 1 and do not assign an id before inheriting a real table. makes more sense in the relayctl output. ok pyr@
2008-07-17use getaddrinfo/getnameinfo to parse ipv6 addresses instead ofReyk Floeter
inet_pton/inet_ntop to allow specifing and printing the IPv6 scope identifier. synced host_v6() with ntpd's version to use getaddrinfo() instead of inet_pton() - host_v4, host_v6, and host_dns could all use getaddrinfo in a single function by specifing different flags but this would diverge from the other daemons using this common interface so we keep this little overhead. discussed with henning@ ok pyr@
2008-07-16relay_connect() may fail, close the session in the bindany callbackReyk Floeter
if it does.
2008-07-16use getsockname() to find out the local address of a connection beforeReyk Floeter
doing a nat lookup. this fixes nat lookups when the relay is listening to a wildcard IPv4/IPv6 address (like 0.0.0.0 or ::).
2008-07-16fix nat lookup to use the correct pf_addr offset. now it also worksReyk Floeter
with ipv6.
2008-07-09always verify that the received dns response id matches our request.Reyk Floeter
2008-07-09Use OpenBSD's knuth shuffle algorithm of random values from bind toReyk Floeter
produce the DNS request ids instead of a simple per-request arc4random(). This ensure randomness but also satisfies the non-repeating property we need. ok deraadt@
2008-07-09also set the protocol, either TCP or UDP, in the NAT lookup. thisReyk Floeter
unbreaks NAT lookups with UDP; tested as a transparent DNS relay.
2008-07-09only use SOCK_STREAM for TCP in bindany(), otherwise SOCK_DGRAM for UDP.Reyk Floeter
2008-07-09update the relay dns code to open a new udp socket to send theReyk Floeter
forwarded dns request to the server instead of sending from the server socket. this will fix the limitation the the dns relay had to listen to the "0.0.0.0" address, and will also enable relayd to use the udp source port randomization. relayd will know randomize the source port (on OpenBSD) and DNS request identifier for the clients behind it. ok pyr@
2008-06-11add support for "transparent" forwarding in relays: normally the l7Reyk Floeter
relay will connect to the target host with its own ip address, but this mode will let it use the address of the client that is connecting from the other side. for example, there is no need to add the X-Forwarded-For HTTP headers for internal webservers in this mode anymore since they magically see the remote client ip address in the connection. it also allows to build fully-transparent ssl encapsulation for tcp sessions and many other things... based on an initial idea from dlg@ and pascoe@ (dlg's talk at opencon) using the new BINDANY and divert-reply interfaces from markus@ (since n2k8) ok markus@ pyr@
2008-06-11tweak the "route to" text;Jason McIntyre
2008-06-10set the inactivity timeout of redirections to a shorter timeout of 600Reyk Floeter
seconds by default (pf's default is 86400s), they can be cranked with the "session timeout" directive and it is consistent to relay session timeouts. also remove the hack to modify the closing timeout because pf's sloppy state handling is taking care about half connection closing now.
2008-06-10use sloppy pf state keeping for routed sessions (direct server return)Reyk Floeter
where we only see the client side of the TCP session; this removes the timeout limitations that we had before. document "route to" in the manpage since it is fully working now.
2008-05-22- fix a bug in msgbuf_write() that caused a descriptor to stay in the fdGilles Chehade
list even after being sent successfully. this has imsg_get_fd() keep returning the first fd. no impact in relayd. "go for it" pyr@, "yeah someone screwed up in the copy" henning@
2008-05-17documentation tweaks.Igor Sobrado
ok (some time ago) jmc@
2008-05-16Clear source nodes on table changes in sticky mode. This has thePierre-Yves Ritschard
disadvantage of removing valid src nodes, but the advantage of not sending out traffic to hosts that are not up anymore. From a diff by <mkoc@prime.pl>, ok reyk@
2008-05-12Error out with usage line if additional arguments are given after thePierre-Yves Ritschard
option parsing. Found out the hard way by jdixon on ifstated. ok sobrado@, jdixon@, millert@
2008-05-08move the session keys used by dns in a protocol-specific private ptr.Reyk Floeter
2008-05-08missed to set the default for tables to round-robin, so it wasReyk Floeter
loadbalance after the grammar change. make it round-robin again.
2008-05-07add an alternative "route to" mode to relayd redirections which mapsReyk Floeter
to pf route-to instead of the default rdr. it is a first steps towards support for "direct server return" (dsr), an asynchronous mode where the load balanced servers send the replies to a different gateway like a l3 switch/router to handle higher amounts of return traffic. because the state handling in pf isn't optimal for this case yet, it just sees half of the TCP connection, the sessions are forced to time out after fixed number of seconds. discussed with many, thought about in the onsen
2008-05-06tweak previous;Jason McIntyre
2008-05-06the manpage mentioned "timeout" in relay sections, while the grammarReyk Floeter
expected the keywords "forward timeout". rename it to "session timeout" and sync the documentation with reality.
2008-05-06the message digest http check does not work on binary content, add manpageReyk Floeter
clarification. From bsd at openbsd dot rutgers dot edu, closes pr5801 ok pyr@