From: reyk Date: Fri, 8 Aug 2008 22:49:33 +0000 (+0000) Subject: add a variable $SERVER_NAME which is "OpenBSD relayd" by default. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2341366b81c590cd4baac931ec38e8ac9e707091;p=openbsd add a variable $SERVER_NAME which is "OpenBSD relayd" by default. --- diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c index 8c02fbfd568..9f1d52764dc 100644 --- a/usr.sbin/relayd/relay.c +++ b/usr.sbin/relayd/relay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay.c,v 1.100 2008/08/08 20:34:30 reyk Exp $ */ +/* $OpenBSD: relay.c,v 1.101 2008/08/08 22:49:33 reyk Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Reyk Floeter @@ -1003,6 +1003,11 @@ relay_expand_http(struct ctl_relay_event *cre, char *val, char *buf, size_t len) "$SERVER_PORT", ibuf) != 0) return (NULL); } + if (strstr(val, "$SERVER_NAME") != NULL) { + if (expand_string(buf, len, + "$SERVER_NAME", RELAYD_SERVERNAME) != 0) + return (NULL); + } } if (strstr(val, "$TIMEOUT") != NULL) { snprintf(ibuf, sizeof(ibuf), "%lu", rlay->rl_conf.timeout.tv_sec); diff --git a/usr.sbin/relayd/relayd.conf.5 b/usr.sbin/relayd/relayd.conf.5 index 55989fd9f21..68b243a5609 100644 --- a/usr.sbin/relayd/relayd.conf.5 +++ b/usr.sbin/relayd/relayd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: relayd.conf.5,v 1.92 2008/07/25 12:29:33 jmc Exp $ +.\" $OpenBSD: relayd.conf.5,v 1.93 2008/08/08 22:49:33 reyk Exp $ .\" .\" Copyright (c) 2006, 2007 Reyk Floeter .\" Copyright (c) 2006, 2007 Pierre-Yves Ritschard @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 25 2008 $ +.Dd $Mdocdate: August 8 2008 $ .Dt RELAYD.CONF 5 .Os .Sh NAME @@ -765,6 +765,9 @@ The TCP source port of the connected client. The configured IP address of the relay. .It Ic $SERVER_PORT The configured TCP server port of the relay. +.It Ic $SERVER_NAME +The server software name of +.Xr relayd 8 . .It Ic $TIMEOUT The configured session timeout of the relay. .El