summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
AgeCommit message (Collapse)Author
2019-10-03Make relayd properly return the next element, even if the requested elementMartijn van Duren
doesn't exist in its own structure. This could greatly be improved upon, but it makes snmp walk on its mib work. OK claudio@
2019-09-18remove old log options 'log update/all' that were replaced with 'logSebastian Benoit
state changes/host checks/connection' some time ago. ok reyk@ claudio@ on first version, kn@ noticed that the tokens could be removed too.
2019-09-15Add support for binary protocol health checking. Feedback and guidance fromrob
benno@ and reky@. Man page tweaks from jmc@. ok benno@
2019-08-30revert r1.175 which added unveil to relayd; "check script" needs access to theStuart Henderson
filesystem. "Well the first step is to back the commit out" deraadt@
2019-07-13fix error description on invalid forward ip.Christopher Zimmermann
OK benno@
2019-07-13Don't "forward to <table>" when a "forward to destination" address is set.Christopher Zimmermann
This matches the documented behaviour. On matching "forward to <table>" filter rules the "forward to destination" address is unset, so that in that case the "forward to <table>" rule is still used. OK benno@, regression tests still passing.
2019-07-05Add a new macro called $HOST that expands to the Host header's value or fallsRobert Nagy
back to the same value as $SERVER_ADDR in case the Host header is not available. ok reyk@
2019-07-05Fix integer sizes in format strings and enable formatting warningsPatrick Wildt
for yyerror. From Moritz Buhl ok claudio@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-26Add support for OCSP staplingReyk Floeter
Many thanks to Bruno Flueckiger who independently sent a very similar patch. He also tested the one I'm committing that it works as expected. OK tb@
2019-06-01Make sure that the IMSG_CTL_RESET message is sent immediately.Reyk Floeter
This fixes an issue that might better be solved in imsg itself. The problem is that IMSG_CTL_RESET does not include an fd while the following messages (IMSG_CFG_RELAY and IMSG_CFG_RELAY_FD) do contain fds. If the receiver gets them in one buffer (via recvmsg), the first fd might be wrongly associated to the IMSG_CTL_RESET message. This is theoretically taken care of by the imsg API, so it is either a bug in relayd's API usage or in imsg itself. "sure" claudio@ as a temporary fix.
2019-05-31Add support for SNI with new "tls keypair" option to load additional certs.Reyk Floeter
Tested by many (thanks!) Feedback & OK rob@
2019-05-31Move the relay keys/certs into a separate global list and look them up by id.Reyk Floeter
Moving the certs out of the relay struct will help to add multiple SNI certs. Tested by many users (thanks!) Feedback & OK rob@
2019-05-29Fix the check if a relay has been specified twiceReyk Floeter
Relays cannot have the same name or listen address. If a listen address is specified multiple times, the parser expands the configuration into multiple relays automatically. OK rob@
2019-05-29Move relay_load_*() functions into relayd.cReyk Floeter
Pass the *env as an explicit argument instead of using the global pointer: The relay_load_certfiles() function is called early before the *env is set up. This does not change anything in the current code as *env is not used by anything in the function (not even ssl_load_key() that is taking it as an argument) but it will be needed by upcoming changes for SNI. Ok rob@
2019-05-13Add Connection: close when switching to "unlimited" reading mode.Reyk Floeter
Ask the server to close the connection after the request since we don't read any further request headers. This fixes an issue with OPTIONS and optional body, as well as similar cases. Reported and tested by Rivo Nurges OK benno@
2019-05-13Fix filter rules with "forward to" statement in persistent connections.Reyk Floeter
OK bentley@ mikeb@
2019-05-10Add support for from/to in relay filter rules.Reyk Floeter
For example, pass from 10.0.0.0/8 path "/hello/*" forward to <b> Ok benno@
2019-05-08Fix and tweak websocket upgrade handling.Reyk Floeter
- Don't expect the Connection header to equal Upgrade, it may include Upgrade - Reshuffle the code to check the Upgrade/Connection headers in one place Reported and tested by Rivo Nurges OK and input from benno@ Cvs: ----------------------------------------------------------------------
2019-04-24restrict filesystem access to read only on main process via unveil(2)Ricardo Mestre
ok benno@ deraadt@
2019-03-13remove unused keyword "virtual".Sebastian Benoit
ok gcc, claudio@ agrees
2019-03-04Support for rfc 6455 Websockets connection upgrade. Add a new protocolSebastian Benoit
option 'http { [no] websockets }' to allow such connections (default is no). Original diff from Daniel Lamando (dan AT danopia DOT net), option and header checks by me. suggestions and ok bluhm@ and earlier diff claudio@
2019-02-13(unsigned) means (unsigned int) which on ptrdiff_t or size_t or otherTheo de Raadt
larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
2018-11-01- odd condition/test in PF lexerAlexandr Nedvedicky
(and other lexers too) This commit rectifies earlier change: in the lex... even inside quotes, a \ followed by space or tab should expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). OK deraadt@, OK millert@
2018-10-22Make host_*() AF-agnosticdenis
Merge host_v{4,6}() into much simpler host_ip() using just getaddrinfo(). With input & test by kn@ and benno@ OK benno@ kn@
2018-09-19Do not abort when the ca privenc runs into a timeout.Reyk Floeter
OK claudio@
2018-09-09During the fork+exec implementation, daemon(3) was moved afterAlexander Bluhm
proc_init(). As a consequence httpd(8) and relayd(8) child processes did not detach from the terminal anymore. Dup /dev/null to the stdio file descriptors in the children. OK benno@
2018-09-07replace malloc()+strlcpy() with strndup() in cmdline_symset().miko
"looks good" gilles@ halex@
2018-09-01Accidentally relayd(8) closed file descriptor 0 in the pfe childAlexander Bluhm
process. If env->sc_snmp is initialized with 0, snmp_init() closes it. Set it to -1 to prevent the close(2). OK reyk@ benno@ millert@
2018-08-06space required between macro args and punctuation;Jason McIntyre
2018-08-06replace the current log optionsSebastian Benoit
log updates|all with log state changes log host checks log connection [errors] The first two control the logging of host check results: either changes in host state only or all checks. The third option controls logging of connections in relay mode: Either log all connections, or only errors. Additionaly, errors will be logged with LOG_WARN and good connections will be logged with LOG_INFO, so they can be differentiated in syslog. ok and feedback from claudio@
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-09No need to mention which memory allocation entry point failed (malloc,Kenneth R Westerback
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
2018-06-18remove the SECTIONS header, since a one line DESCRIPTION is a bit silly;Jason McIntyre
use a more general text for the sections, and avoid the catchup issue that was trying to document how many there were; ok benno rob
2018-06-11Fix an off-by-one line count when using include statements.denis
Thanks to otto@ for the initial diff. OK benno@
2018-06-10When a TLS error occurs, print the tls_error() message as part of theSebastian Benoit
connection closed log message, not just as debug message. ok claudio@ reyk@
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-04-20adjust the example to make it work;Jason McIntyre
from matt schwartz ok claudio
2018-04-18Remove RELAY_MAX_SESSIONS from relayd, there is no reason to limit relaysClaudio Jeker
to 1024 session per process (esp. with keep-alive). Now the fd limit is the new maximum and relayd will make sure to not accept too many sessions. The tcp backlog config maximum is now 512, adjust manpage accordingly. OK benno@ deraadt@
2018-04-14In case of a tcp read timeout, the destination host state needs to beSebastian Benoit
set to HOST_DOWN. Noticed and fixed by Rivo Nurges <Rivo DOT Nurges AT smit DOT ee> ok and reminder florian@
2018-01-24Log some more errors in the ca code, since there seems to be still a bugClaudio Jeker
hidden somewhere. Also return after a poll timeout, there is no reason to wait longer than a second for the answer of the ca process. OK jsing@
2018-01-01RSA_private_{en,de}crypt() can fail and will return -1 in that case.Claudio Jeker
Check for this in the ca process and return a valid answer to the relay process. This fixes rsae_send_imsg poll timeouts blocking relay processes as seen by Mischa Peters and myself. OK benno@
2017-12-27log specific error when connect() fails.Sebastian Benoit
ok claudio@, feedback bluhm@
2017-12-18always initialize the hce_launch_checks event timer.Sebastian Benoit
Fixes a crash when poll is run without any checks. Found and fixed by Hiltjo Posthuma (hiltjo -AT- codemadness -DOT- org). ok claudio@
2017-11-29fix double dot;Jason McIntyre
2017-11-29add options to specify the control socket in relayd and relayctl.Sebastian Benoit
From Kapetanakis Giannis, thanks. ok claudio@
2017-11-28One less lie in commentsClaudio Jeker
2017-11-28Introduce relay_reset_event() which closes and resets a relay connection.Claudio Jeker
Currently this is only used by relay_close() but will be needed in near future. OK benno@
2017-11-28In TLS inspection mode we also need to keep the server tls object around.Claudio Jeker
For this we need to add an additional pointer to the ctl_relay_event. Diff from Petri Mikkila (pmikkila at gmail) OK benno@
2017-11-28relay_load_fd() is no longer clobering errno in the error case so useClaudio Jeker
fatal() instead of fatalx()