OpenBSD CVS

CVS log for src/usr.sbin/relayd/hce.c


[BACK] Up to [local] / src / usr.sbin / relayd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.82 / (download) - annotate - [select for diffs], Sat May 18 06:34:46 2024 UTC (3 weeks ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.81: +1 -2 lines
Diff to previous 1.81 (colored)

remove prototypes with no matching function

Revision 1.81 / (download) - annotate - [select for diffs], Fri Jun 3 13:23:16 2022 UTC (2 years ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.80: +3 -1 lines
Diff to previous 1.80 (colored)

Check tls_config_new() for NULL return

This way we don't crash in tls_config_insecure_noverify_cert().

From Mateusz Piotrowski on bugs

ok claudio

Revision 1.80 / (download) - annotate - [select for diffs], Mon Feb 22 01:24:59 2021 UTC (3 years, 3 months ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.79: +1 -2 lines
Diff to previous 1.79 (colored)

Use the F_CHECK_SENT and F_CHECK_DONE flags to determine whether a
previous attempt at running a check script has finished yet, so we
can avoid building up a backlog of check requests.

ok dlg@ tb@ giovanni@

Revision 1.79 / (download) - annotate - [select for diffs], Mon Aug 6 17:31:31 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.78: +2 -4 lines
Diff to previous 1.78 (colored)

replace the current log options

 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@

Revision 1.78 / (download) - annotate - [select for diffs], Mon Dec 18 21:45:57 2017 UTC (6 years, 5 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.77: +2 -3 lines
Diff to previous 1.77 (colored)

always initialize the hce_launch_checks event timer.
Fixes a crash when poll is run without any checks.
Found and fixed by Hiltjo Posthuma (hiltjo -AT- codemadness -DOT- org).
ok claudio@

Revision 1.77 / (download) - annotate - [select for diffs], Sun May 28 10:39:15 2017 UTC (7 years ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.76: +9 -9 lines
Diff to previous 1.76 (colored)

use __func__ in log messages. fix some whitespace while here.
From Hiltjo Posthuma hiltjo -AT codemadness -DOT- org, thanks!
ok florian, claudio

Revision 1.76 / (download) - annotate - [select for diffs], Sat May 27 08:33:25 2017 UTC (7 years ago) by claudio
Branch: MAIN
Changes since 1.75: +5 -3 lines
Diff to previous 1.75 (colored)

Migrate relayd to use libtls for TLS. Still does the TLS privsep via the
engine but at least we can use a sane API for new features.
Going in now so it is possible to work with this in tree.
General agreement at d2k17.

Revision 1.75 / (download) - annotate - [select for diffs], Sat Sep 3 14:09:04 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

Use the fork+exec privsep model in relayd; based on rzalamena@'s work
for httpd with some (current and previous) changes for relayd.  Once
again, both daemons now share the same proc.c where most of the
privsep "magic" happens.

OK benno@ rzalamena@

Revision 1.74 / (download) - annotate - [select for diffs], Fri Sep 2 14:45:51 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (colored)

Split "struct relayd" into two structs: "struct relayd" and "struct
relayd_config".  This way we can send all the relevant global
configuration to the children, not just the flags and the opts.

With input from and
OK claudio@ benno@

Revision 1.73 / (download) - annotate - [select for diffs], Fri Sep 2 11:51:49 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

Terminate relayd using the socket status instead of watching SIGCHLD
or killing child processes. - Based on rzalamena@'s diff for httpd.

OK deraadt@ rzalamena@

Revision 1.72 / (download) - annotate - [select for diffs], Mon Jan 11 21:31:42 2016 UTC (8 years, 4 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.71: +7 -2 lines
Diff to previous 1.71 (colored)

This adds the host_error output and the http code (when available) to the
host-check log.
ok claudio@

Revision 1.71 / (download) - annotate - [select for diffs], Wed Dec 2 13:41:27 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.70: +3 -4 lines
Diff to previous 1.70 (colored)

In most cases we don't need all arguments of proc_compose*_imsg(),
so add a shortcut proc_compose*() that skips all of them.  Only use the
full argument list if needed.  The functions with full argument lists can
eventually be replaced with a nicer transaction-based approach later.

OK benno@

Revision 1.70 / (download) - annotate - [select for diffs], Sat Nov 28 18:10:12 2015 UTC (8 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.69: +4 -1 lines
Diff to previous 1.69 (colored)

pledge: allow getsockopt IP_IPDEFTTL with promise inet
then relayd's host check engine can be pledged.
ok reyk@, approach suggested by deraadt@ weeks ago.

Revision 1.69 / (download) - annotate - [select for diffs], Thu Jan 22 17:42:09 2015 UTC (9 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.68: +4 -14 lines
Diff to previous 1.68 (colored)

Clean up the relayd headers with help of include-what-you-use and some
manual review.  Based on common practice, relayd.h now includes the
necessary headers for itself.

OK benno@

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jan 16 15:06:40 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.67: +1 -2 lines
Diff to previous 1.67 (colored)

Adapt to <limits.h> universe.
ok millert

Revision 1.67 / (download) - annotate - [select for diffs], Fri Dec 12 10:05:09 2014 UTC (9 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.66: +5 -5 lines
Diff to previous 1.66 (colored)

Change the keyword "ssl" to "tls" to reflect reality since we
effectively disabled support for the SSL protocols.  SSL remains a
common term describing SSL/TLS, there is some controvery about this
change, and the name really doesn't matter, but I feel confident about
it now.

(btw., sthen@ pointed out some historical context:
http://tim.dierks.org/2014/05/security-standards-and-name-changes-in.html)

OK benno@, with input from tedu@

Revision 1.66 / (download) - annotate - [select for diffs], Wed Nov 19 10:24:40 2014 UTC (9 years, 6 months ago) by blambert
Branch: MAIN
Changes since 1.65: +14 -9 lines
Diff to previous 1.65 (colored)

Support exporting relayd statistics via AgentX/snmpd

This should be equivalent to the statistics available
via the various relaydctl show commands

okay benno@ reyk@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Oct 25 03:23:49 2014 UTC (9 years, 7 months ago) by lteo
Branch: MAIN
Changes since 1.64: +1 -2 lines
Diff to previous 1.64 (colored)

Remove unnecessary netinet/in_systm.h include.

ok millert@

Revision 1.64 / (download) - annotate - [select for diffs], Sun Mar 10 23:32:53 2013 UTC (11 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.63: +3 -5 lines
Diff to previous 1.63 (colored)

This diff changes relayd to use the monotonic clock instead of
gettimeofday().  It was also bugging me for some time to have all
these checks of gettimeofday()'s return value: it should not fail.  So
this diff introduces a void getmonotime(struct timeval *tv) that calls
clock_gettime(CLOCK_MONOTONIC, &ts) and converts the output to a
struct timeval that can be used with the existing code and the
timeval-specific timer functions (timerclear, timersub, ...).  It does
not return a status but calls fatal() on error-that-should-not-happen.

ok sthen@ chris@

Revision 1.63 / (download) - annotate - [select for diffs], Wed May 9 12:54:13 2012 UTC (12 years, 1 month ago) by giovanni
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.62: +19 -5 lines
Diff to previous 1.62 (colored)


Fix a desynchronization on host change during a running check
closes pr system/6627
diff submitted by Martin Matuska, thanks
ok benno@

Revision 1.62 / (download) - annotate - [select for diffs], Sat Jan 21 13:40:48 2012 UTC (12 years, 4 months ago) by camield
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.61: +3 -1 lines
Diff to previous 1.61 (colored)

Only start the child processes after all of them reported to have loaded
the config.  Solves a race at startup time where processes can send status
messages about hosts that other processes don't know about yet.
(and have relayd abort with "desynchronized" or "invalid host id")

ok henning pyr deraadt
solves the problem ok from benno todd

Revision 1.61 / (download) - annotate - [select for diffs], Sat Nov 12 19:36:17 2011 UTC (12 years, 6 months ago) by camield
Branch: MAIN
Changes since 1.60: +5 -5 lines
Diff to previous 1.60 (colored)

fix function names in fatalx() messages

ok mikeb

Revision 1.60 / (download) - annotate - [select for diffs], Thu May 19 08:56:49 2011 UTC (13 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.59: +28 -50 lines
Diff to previous 1.59 (colored)

Fix reload support in relayd(8) by reimplementing large parts of the
daemon infrastructure. The previous design made it fairly hard to
reload the complex data structures, especially relays and protocols.
One of the reasons was that the privsep'd relayd processes had two
ways of getting their configuration: 1) from memory after forking from
the parent process and 2) and (partially) via imsgs after reload.  The
new implementation first forks the privsep'd children before the
parents loads the configuration and sends it via imsgs to them; so it
is only like 2) before.  It is based on an approach that I first
implemented for iked(8) and I also fixed many bugs in the code.

Thanks to many testers including dlg@ sthen@ phessler@
ok pyr@ dlg@ sthen@

Revision 1.59 / (download) - annotate - [select for diffs], Mon May 9 12:08:47 2011 UTC (13 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.58: +124 -295 lines
Diff to previous 1.58 (colored)

Reorganize the relayd code to use the proc.c privsep API/commodity
functions that are based on work for iked and smtpd.  This simplifies
the setup of privsep processes and moves some redundant and repeated
code to a single place - which is always good from a quality and
security point of view.  The relayd version of proc.c is different to
the current version in iked because it uses 1:N communications between
processes, eg. a single parent process is talking to many forked relay
children while iked only needs 1:1 communications.

ok sthen@ pyr@

Revision 1.58 / (download) - annotate - [select for diffs], Thu May 5 12:01:43 2011 UTC (13 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.57: +7 -7 lines
Diff to previous 1.57 (colored)

Update all logging and debug functions to use the __func__ macro
instead of static function names.  __func__ is C99 and perfectly fine
to use. It also avoids printing errors; for example if a statement
log_debug("foo:"..) was moved or copied from function foo() to bar()
and the log message was not updated...

Revision 1.57 / (download) - annotate - [select for diffs], Tue Feb 8 08:52:28 2011 UTC (13 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

Log the time taken for all types of check, not just tcp checks.
ok pyr@

Revision 1.56 / (download) - annotate - [select for diffs], Tue Nov 30 14:38:45 2010 UTC (13 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.55: +4 -1 lines
Diff to previous 1.55 (colored)

The relayd processes did already bump up the socket file descriptor
resource limits to the maximum of the daemon class but the host check
process (hce/health checks) didn't and was limited to a fairly low
default of 128 open sockets (openfiles-cur=128 in login.conf). This
was reached fairly quickly with "check tcp" of many hosts. This diff
increases the maximum number of monitored hosts and concurrent health
checks in relayd in a significant way and may fix issues for people
that have around 100 or more hosts (or fewer hosts with multiple checked
ports).

tested by phessler@
ok jsg@

Revision 1.55 / (download) - annotate - [select for diffs], Fri May 14 11:13:36 2010 UTC (14 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.54: +17 -9 lines
Diff to previous 1.54 (colored)

allocate all struct event's on the heap, it looks cleaner, feels better
and follows a suggestion in event.h.  also don't mix signal() and
signal_set()/signal_add().

ok jsg@ gilles@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Jan 11 06:40:14 2010 UTC (14 years, 5 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.53: +6 -1 lines
Diff to previous 1.53 (colored)

add "log brief" and "log verbose" to change logging verbosity
like several other things in the tree.

ok reyk@ looks fine claudio@

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jun 5 23:39:51 2009 UTC (15 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.52: +32 -26 lines
Diff to previous 1.52 (colored)

4 handed diff with eric:
Stop pushing event handling in the imsg framework.
Instead, provide a small glue layer on top of both imsg and libevent.
This finally clearly separates event handling and imsg construction.

Sidetrack bonus: remove the mega-ugly hack of having a dummy imsg_event_add
stub in relayctl.

This will make bgpd (and thus henning) happy. Next up are smtpd and ospfd.

ok eric@

Revision 1.52 / (download) - annotate - [select for diffs], Fri Jun 5 00:20:50 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.51: +3 -2 lines
Diff to previous 1.51 (colored)

some KNF cleanup following the last sed.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jun 5 00:04:01 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

Make imsg completely async model agnostic by not requiring an
imsg_event_add function to be provided (which ended up being a named
callback).
Instead provide a wrapper in the daemon and call that everywhere.
Previsously discussed with the usual suspects,
ok eric@ though not too happy about the function name
(imsg_compose_event).

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jun 4 13:46:07 2009 UTC (15 years ago) by reyk
Branch: MAIN
Changes since 1.49: +1 -2 lines
Diff to previous 1.49 (colored)

Keep around the SSL session for each checked host. This way SSL
caching can kick in on subsequent checks, making them faster and
lighter on the server.

From camield, closes PR 6137 (modified diff)

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jun 2 12:24:16 2009 UTC (15 years ago) by reyk
Branch: MAIN
Changes since 1.48: +1 -5 lines
Diff to previous 1.48 (colored)

remove extra imsg_event_add() after EV_WRITE checks - this is not
required because it is called later and there is no return before.

ok gilles@

Revision 1.48 / (download) - annotate - [select for diffs], Tue Jun 2 11:33:06 2009 UTC (15 years ago) by reyk
Branch: MAIN
Changes since 1.47: +11 -13 lines
Diff to previous 1.47 (colored)

Libevent may do an upcall with both EV_READ and EV_WRITE set.
So change the code accordingly to allow that.

Found by claudio@ in ospfd

Revision 1.47 / (download) - annotate - [select for diffs], Fri Apr 17 09:47:06 2009 UTC (15 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.46: +7 -3 lines
Diff to previous 1.46 (colored)

keep the parent relations of hosts after reloading the configuration.

From Camiel Dobbelaar, closes PR 6066

Revision 1.46 / (download) - annotate - [select for diffs], Fri Dec 5 16:37:55 2008 UTC (15 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.45: +12 -3 lines
Diff to previous 1.45 (colored)

change the way relayd reports check results: instead of logging an
arbitrary string in debugging mode, it will store an error code
(HCE_*) for each host.  the error code can be translated to a string
(in log.c) for debugging but it will also be passed to relayctl via
the control socket.

from a user point of view, this will print a human-readable error
message in the "relayctl show hosts" output if a host is down because
the check failed.  the relayctl(8) manpage includes detailed
explanations of the error messages including mitigations for the
most-common problems.

ok jmc@ (manpages)
ok phessler@

Revision 1.45 / (download) - annotate - [select for diffs], Mon Sep 29 15:12:22 2008 UTC (15 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

spacing

Revision 1.44 / (download) - annotate - [select for diffs], Fri Aug 8 08:51:21 2008 UTC (15 years, 10 months ago) by thib
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

Check gettimeofday() against -1; Add a missing error check in one place.

OK reyk@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jul 19 11:38:54 2008 UTC (15 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

no need for using a TAILQ queue for the host children list, use a
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.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jul 19 10:52:32 2008 UTC (15 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.41: +15 -2 lines
Diff to previous 1.41 (colored)

If the new 'parent' keyword is specified for a host in a table,
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

Revision 1.41 / (download) - annotate - [select for diffs], Wed Mar 12 10:50:44 2008 UTC (16 years, 3 months ago) by pyr
Branch: MAIN
Changes since 1.40: +1 -3 lines
Diff to previous 1.40 (colored)

nuke unused variable.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Feb 11 10:42:50 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.39: +7 -1 lines
Diff to previous 1.39 (colored)

Marry relayd with snmpd using new "send trap" option: Request to send
a SNMP trap when the state of a host changes.  relayd(8) will try to
(re-)connect to snmpd(8) and request it to send a trap to the
registered trap receivers, see snmpd.conf(5) for more information
about the configuration.

ok pyr@ thib@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Jan 31 09:33:39 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.38: +27 -27 lines
Diff to previous 1.38 (colored)

add prefixes to names of structure elements to make it easier to grep
for code, start with struct relayd.  finally.

ok thib@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Dec 8 20:36:36 2007 UTC (16 years, 6 months ago) by pyr
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

Rename everything which reffered to services refer to rdr for internals
(for instance: rename struct service to struct rdr), refer to redirects
otherwise (hoststatectl output).
ok reyk@

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 7 17:17:00 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.36: +10 -10 lines
Diff to previous 1.36 (colored)

hoststated gets renamed to relayd.  easier to type, and actually says
what the daemon does - it is a relayer that pays attention to the status
of pools of hosts; not a status checkers that happens to do some relaying

Revision 1.36 / (download) - annotate - [select for diffs], Sat Nov 24 17:07:28 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.35: +5 -4 lines
Diff to previous 1.35 (colored)

sort includes, adjust to style(9)

Revision 1.35 / (download) - annotate - [select for diffs], Wed Nov 21 09:54:39 2007 UTC (16 years, 6 months ago) by pyr
Branch: MAIN
Changes since 1.34: +3 -1 lines
Diff to previous 1.34 (colored)

make sure all hosts are checked when hoststatectl poll is issued, now
that check interval can differ from table to table.
ok reyk@

Revision 1.34 / (download) - annotate - [select for diffs], Tue Nov 20 15:44:21 2007 UTC (16 years, 6 months ago) by pyr
Branch: MAIN
Changes since 1.33: +7 -1 lines
Diff to previous 1.33 (colored)

Allow overriding the global interval in a table.
Table specific intervals must be multiples of the global interval.
help and ok reyk@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Nov 19 15:31:36 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

spacing

Revision 1.32 / (download) - annotate - [select for diffs], Fri Oct 19 12:08:55 2007 UTC (16 years, 7 months ago) by pyr
Branch: MAIN
Changes since 1.31: +5 -1 lines
Diff to previous 1.31 (colored)

Add the ability to schedule an immediate check through hoststatectl.
Especially useful when interval is rather long.
I was supposed to commit this before 4.2.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Oct 12 12:50:59 2007 UTC (16 years, 8 months ago) by blambert
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Silence some lint(1) warnings

ok pyr@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Sep 28 13:29:56 2007 UTC (16 years, 8 months ago) by pyr
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

Correct my mail address.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jun 19 13:06:00 2007 UTC (16 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.28: +2 -7 lines
Diff to previous 1.28 (colored)

don't go through the effort of creating a SIGHUP handler through
libevent just to ignore it, use SIG_IGN instead.
this syncs hoststated with bgpd and (soon) ospfd.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jun 19 06:29:20 2007 UTC (16 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.27: +13 -5 lines
Diff to previous 1.27 (colored)

Do not fatal out with ``pipe closed'' when a short read occurs on one
of our socket pairs. Instead disable listening on the pipe, terminate the
event loop, and let the parent process's SIGCHLD handler do a clean
shutdown.

from an ospfd diff by claudio, ok claudio@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jun 12 15:16:10 2007 UTC (17 years ago) by msf
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

put the fd passing from bgpd back in to hoststated's version of imsg,
needed for layer 7 reload support.

ok pyr@

Revision 1.26 / (download) - annotate - [select for diffs], Thu Jun 7 07:19:50 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.25: +53 -1 lines
Diff to previous 1.25 (colored)

(finally) Enable reload support for layer 3 configurations.
Hoststated can be reloaded either by sending SIGHUP to the parent process
or by using ``hoststatectl reload''
discussed and ok reyk@

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 31 05:07:08 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.24: +53 -52 lines
Diff to previous 1.24 (colored)

split event registration between the ones that will be kept intact
at reconfiguration time.

Revision 1.24 / (download) - annotate - [select for diffs], Thu May 31 03:26:36 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.23: +1 -7 lines
Diff to previous 1.23 (colored)

some silly debug code snuck in.

Revision 1.23 / (download) - annotate - [select for diffs], Thu May 31 03:24:05 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.22: +64 -24 lines
Diff to previous 1.22 (colored)

allocate table lists and service lists instead of using static structs.
split the code to start the event loop in two functions.
introduce merge_config which will be used later on.

Revision 1.22 / (download) - annotate - [select for diffs], Tue May 29 17:12:04 2007 UTC (17 years ago) by reyk
Branch: MAIN
Changes since 1.21: +31 -16 lines
Diff to previous 1.21 (colored)

add a new check method which allows to run external scripts/programs
for custom evaluations.

pyr agrees to put it in now but to do some improvements of the timeout
handling later.

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 28 22:11:33 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

another small step towards hoststated reloading.
allow purging of parts of the hoststated environment structure.
start using this function now to only keep vital information in
hoststated children processes.

ok reyk@

Revision 1.20 / (download) - annotate - [select for diffs], Sun May 27 20:53:10 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.19: +14 -14 lines
Diff to previous 1.19 (colored)

Second step towards hoststated reload:
First split out hosts, tables and services into to structs, one that
contains the runtime fields and one (inside the runtime) that contains
mostly static fields that will be sent over the socket during reload.

Also move the demoted field of tables inside the flags field as its
just a boolean.
ok reyk@

Revision 1.19 / (download) - annotate - [select for diffs], Sat May 26 19:58:48 2007 UTC (17 years ago) by pyr
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

first steps for implementing reload:
	* make parse_config allocate the hoststated function by itself
	* make as many sockets as necessary to talk to the relay children
	* add send_all for talking to all children
with advise and ok reyk@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Mar 7 17:40:32 2007 UTC (17 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

- fix the hoststatectl host disable/enable commands to work with relay
layer 7 loadbalancing.
- allow to run relays with tables without depending on services
- show hosts and tables assigned to relays in hoststatectl show commands

ok pyr@ deraadt@ with some input from mcbride@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Mar 6 19:37:31 2007 UTC (17 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.16: +2 -3 lines
Diff to previous 1.16 (colored)

fix the health checks when using the retry option

Revision 1.16 / (download) - annotate - [select for diffs], Thu Feb 22 03:32:39 2007 UTC (17 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.15: +43 -14 lines
Diff to previous 1.15 (colored)

Add layer 7 functionality to hoststated used for layer 7
loadbalancing, SSL acceleration, general-purpose TCP relaying, and
transparent proxying.

see hoststated.conf(5) and my upcoming article on undeadly.org for
details.

ok to commit deraadt@ pyr@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Feb 7 15:17:46 2007 UTC (17 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.14: +28 -2 lines
Diff to previous 1.14 (colored)

add new "log (updates|all)" configuration option to log state
notifications after completed host checks.  either only log the
"updates" to new states or log "all" state notifications, even if the
state didn't change. the log messages will be reported to syslog or to
stderr if the daemon is running in foreground mode.

ok claudio@ pyr@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Feb 7 14:39:45 2007 UTC (17 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

remove superfluos log_debug() messages

ok pyr@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 7 13:39:58 2007 UTC (17 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.12: +1 -21 lines
Diff to previous 1.12 (colored)

remove unused functions and variables which have been copied from
ospfd(8) (can be re-imported later if required).

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jan 29 14:23:31 2007 UTC (17 years, 4 months ago) by pyr
Branch: MAIN
Changes since 1.11: +13 -1 lines
Diff to previous 1.11 (colored)

Add SSL support to hoststated.
with help and OK reyk@
with help and advice by claudio@ and Srebrenko Sehic

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 24 10:26:00 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.10: +2 -1 lines
Diff to previous 1.10 (colored)

Similar to ospfd and ripd ignore SIGPIPE in all processes to be able to do
a nice exit in case one of the processes dies. OK pyr@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jan 11 18:05:08 2007 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.9: +38 -45 lines
Diff to previous 1.9 (colored)

use real async events for checks and improve the non-blocking socket
usage. also modify the check_icmp code to use non-blocking raw sockets
and merge the icmp4 and icmp6 functions. some other minor changes
while i'm here.

as discussed with pyr@ claudio@ deraadt@
ok pyr@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jan 9 13:50:11 2007 UTC (17 years, 5 months ago) by pyr
Branch: MAIN
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

Finish renaming hostated to hoststated.
Note to testers: the user the daemon changes its id to is now _hoststated,
don't forget to update master.passwd.
ok reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jan 9 00:45:32 2007 UTC (17 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

adapt to rename

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 8 20:46:18 2007 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored)

do NOT use the regexp interface. it is way to complicated, error-prone
and we don't know about all the possible security problems.

change the check send/expect code to use the fnmatch(3) interface
using shell globbing rules instead. this allows simple patterns like
"220 * ESMTP*" or "SSH-[12].??-*".

suggested by deraadt@ and otto@
ok Pierre-Yves Ritschard (pyr at spootnik dot org)

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jan 8 16:52:58 2007 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.5: +3 -5 lines
Diff to previous 1.5 (colored)

the timeout values are not allowed to exceed the global interval (i
figured this out while testing hostated against a stottering spamd
where the send/expect timeout needs be > 10 seconds). also use another
struct timeval to store the interval for easier handling in the code.

ok Pierre-Yves Ritschard (pyr at spootnik dot org)

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jan 8 13:37:26 2007 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

add a generic send/expect check using regular expression (see
regex(3)).  this allows to define additional checks for other TCP
protocols.

From Pierre-Yves Ritschard (pyr at spootnik dot org)

Revision 1.4 / (download) - annotate - [select for diffs], Mon Dec 25 18:12:14 2006 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.3: +79 -36 lines
Diff to previous 1.3 (colored)

partial rewrite of the check_* routines to use libevent everywhere
instead of nested select() calls and to handle the non-blocking
sockets properly.

From Pierre-Yves Ritschard (pyr at spootnik dot org)
(with a little help by me)

Revision 1.3 / (download) - annotate - [select for diffs], Sat Dec 16 17:48:27 2006 UTC (17 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

spacing

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 16 12:42:14 2006 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.1: +67 -68 lines
Diff to previous 1.1 (colored)

knf, spacing

please note that some editors will replace tabs with multiple spaces
if you cut & paste code from other sections.  please try to keep the
tabs ;).

Revision 1.1 / (download) - annotate - [select for diffs], Sat Dec 16 11:45:07 2006 UTC (17 years, 5 months ago) by reyk
Branch: MAIN

Import hostated, the host status daemon.  This daemon will monitor
remote hosts and dynamically alter pf(4) tables and redirection rules
for active server load balancing.  The daemon has been written by
Pierre-Yves Ritschard (pyr at spootnik.org) and was formerly known as
"slbd".

The daemon is fully functional but it still needs some work and
cleanup so we don't link it to the build yet.  Some TODOs are a
partial rewrite of the check_* routines (use libevent whenever we
can), improvement of the manpages, and general knf and cleanup.

ok deraadt@ claudio@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.