summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2011-12-28 19:32:35 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2011-12-28 19:32:35 +0000
commitd106457f651c5559c73850e6388875b34321b4bd (patch)
tree8a68f08db15cf35d6f73740839ad054847cc9070 /usr.sbin
parent869270859a44d9398ef412f3ec5bea10687bcaac (diff)
only add the rdomain for hostname lookups, when we have a hostname to lookup.
noticed by zepard at gmail OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ntpd/parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y
index 2934b68d243..c2ee9df6741 100644
--- a/usr.sbin/ntpd/parse.y
+++ b/usr.sbin/ntpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.48 2011/09/21 15:41:30 phessler Exp $ */
+/* $OpenBSD: parse.y,v 1.49 2011/12/28 19:32:34 phessler Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -102,7 +102,9 @@ main : LISTEN ON address listen_opts {
struct listen_addr *la;
struct ntp_addr *h, *next;
- if ((h = $3->a) == NULL && (h->rtable = $4.rtable) &&
+ if ($3->a)
+ $3->a->rtable = $4.rtable;
+ if ((h = $3->a) == NULL &&
(host_dns($3->name, &h) == -1 || !h)) {
yyerror("could not resolve \"%s\"", $3->name);
free($3->name);