summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-11-24 17:43:48 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-11-24 17:43:48 +0000
commit70b8ca4afd0e5e67dad0a0ce2fb07ea602760239 (patch)
tree9593d6435ed393b4ca4c9b3760e25d8e55efc045
parent9102b876462357d73c2b83c97f3a0cf880e85c81 (diff)
tweak for hostnames without dots (like "localhost")
-rw-r--r--usr.sbin/hoststated/relay.c4
-rw-r--r--usr.sbin/relayd/relay.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/relay.c b/usr.sbin/hoststated/relay.c
index 37e752d0930..89c573d2cec 100644
--- a/usr.sbin/hoststated/relay.c
+++ b/usr.sbin/hoststated/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.70 2007/11/24 17:07:28 reyk Exp $ */
+/* $OpenBSD: relay.c,v 1.71 2007/11/24 17:43:47 reyk Exp $ */
/*
* Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1613,6 +1613,8 @@ relay_lookup_url(struct ctl_relay_event *cre, const char *str,
if (dots > (RELAY_MAXLOOKUPLEVELS - 2))
break;
}
+ if (dots == -1)
+ dots = 0;
hi[dots] = ph;
if ((pp = strdup(cre->path)) == NULL) {
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index 37e752d0930..89c573d2cec 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.70 2007/11/24 17:07:28 reyk Exp $ */
+/* $OpenBSD: relay.c,v 1.71 2007/11/24 17:43:47 reyk Exp $ */
/*
* Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1613,6 +1613,8 @@ relay_lookup_url(struct ctl_relay_event *cre, const char *str,
if (dots > (RELAY_MAXLOOKUPLEVELS - 2))
break;
}
+ if (dots == -1)
+ dots = 0;
hi[dots] = ph;
if ((pp = strdup(cre->path)) == NULL) {