From 70b8ca4afd0e5e67dad0a0ce2fb07ea602760239 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Sat, 24 Nov 2007 17:43:48 +0000 Subject: tweak for hostnames without dots (like "localhost") --- usr.sbin/hoststated/relay.c | 4 +++- usr.sbin/relayd/relay.c | 4 +++- 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 @@ -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 @@ -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) { -- cgit v1.2.3