summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2015-03-17 12:54:27 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2015-03-17 12:54:27 +0000
commit11f7351b9924c48e99b058e700a24a3bde9af5f6 (patch)
treee945e12582bd6ee61bcbe96e06d8b14a745ad2a9 /usr.sbin/bind/lib
parentf2ba2f16331bed2fe740cdc22b5d6cd0ee915f74 (diff)
Initialize nameservers ports along with nameservers addresses.
Missing initialization, as hinted by lwres_conf_clear(). Not present in recent bind versions (the code has changed since). This fixes an erratic behaviour when no (valid) nameserver is configured in resolv.conf (dig / nslookup send requests to 127.0.0.1:48830). Problem reported by Pawel S. Veselov who also provided an alternative diff. ok crickets@
Diffstat (limited to 'usr.sbin/bind/lib')
-rw-r--r--usr.sbin/bind/lib/lwres/lwconfig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bind/lib/lwres/lwconfig.c b/usr.sbin/bind/lib/lwres/lwconfig.c
index 0e627aa95ed..6a9368fcbd2 100644
--- a/usr.sbin/bind/lib/lwres/lwconfig.c
+++ b/usr.sbin/bind/lib/lwres/lwconfig.c
@@ -242,8 +242,10 @@ lwres_conf_init(lwres_context_t *ctx) {
confdata->ndots = 1;
confdata->no_tld_query = 0;
- for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++)
+ for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++) {
lwres_resetaddr(&confdata->nameservers[i]);
+ confdata->nameserverports[i] = 0;
+ }
for (i = 0; i < LWRES_CONFMAXSEARCH; i++)
confdata->search[i] = NULL;