summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-06-19 14:44:29 -0400
committerThomas Markwalder <tmark@isc.org>2017-06-19 14:44:29 -0400
commitca22af89996483efd820de0084c964fc336ee7c1 (patch)
tree678b882c7e3c70bc1db5a746a187816f858b4296 /common
parent24f10d6d9c05e975b279656d2bee927d98902095 (diff)
downloadisc-dhcp-ca22af89996483efd820de0084c964fc336ee7c1.tar.gz
[master] Optimized if and when DNS client context and ports are initted
Merges in rt45290.
Diffstat (limited to 'common')
-rw-r--r--common/dns.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/common/dns.c b/common/dns.c
index 0f8be80d..2ca4ba8b 100644
--- a/common/dns.c
+++ b/common/dns.c
@@ -3,8 +3,7 @@
Domain Name Service subroutines. */
/*
- * Copyright (c) 2009-2015 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2001-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -2151,6 +2150,12 @@ ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
isc_sockaddrlist_t *zlist = NULL;
+ /* Creates client context if we need to */
+ result = dns_client_init();
+ if (result != ISC_R_SUCCESS) {
+ return result;
+ }
+
/* Get a pointer to the clientname to make things easier. */
clientname = (unsigned char *)ddns_cb->fwd_name.data;
@@ -2359,6 +2364,12 @@ ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
unsigned char buf[256];
int buflen;
+ /* Creates client context if we need to */
+ result = dns_client_init();
+ if (result != ISC_R_SUCCESS) {
+ return result;
+ }
+
/*
* Try to lookup the zone in the zone cache. As with the forward
* case it's okay if we don't have one, the DNS code will try to