2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

-n master Patch for 30461 and update the auto generated files

Update the auto genrated files to add the required bind9
libraries

Fix up dhcpctl/Makefile.am to include the isccfg lib

Patch for 30461 to allow the DHCP server to find
the name server to update via the DNS
Conflicts:
This commit is contained in:
Shawn Routhier
2013-12-10 04:03:12 +00:00
parent 64fb661cc8
commit e54ff84f08
21 changed files with 847 additions and 45 deletions

View File

@@ -10,5 +10,6 @@ man_MANS = omapi.3
EXTRA_DIST = $(man_MANS)
svtest_SOURCES = test.c
svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a
svtest_LDADD = libomapi.a ../bind/lib/libirs.a ../bind/lib/libdns.a \
../bind/lib/libisccfg.a ../bind/lib/libisc.a

View File

@@ -140,7 +140,8 @@ libomapi_a_OBJECTS = $(am_libomapi_a_OBJECTS)
PROGRAMS = $(noinst_PROGRAMS)
am_svtest_OBJECTS = test.$(OBJEXT)
svtest_OBJECTS = $(am_svtest_OBJECTS)
svtest_DEPENDENCIES = libomapi.a ../bind/lib/libdns.a \
svtest_DEPENDENCIES = libomapi.a ../bind/lib/libirs.a \
../bind/lib/libdns.a ../bind/lib/libisccfg.a \
../bind/lib/libisc.a
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -311,7 +312,9 @@ libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
man_MANS = omapi.3
EXTRA_DIST = $(man_MANS)
svtest_SOURCES = test.c
svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a
svtest_LDADD = libomapi.a ../bind/lib/libirs.a ../bind/lib/libdns.a \
../bind/lib/libisccfg.a ../bind/lib/libisc.a
all: all-am
.SUFFIXES:

View File

@@ -33,6 +33,57 @@
dhcp_context_t dhcp_gbl_ctx;
int shutdown_signal = 0;
#if defined (NSUPDATE)
/* This routine will open up the /etc/resolv.conf file and
* send any nameservers it finds to the DNS client code.
* It may be moved to be part of the dns client code instead
* of being in the DHCP code
*/
isc_result_t
dhcp_dns_client_setservers(void)
{
isc_result_t result;
irs_resconf_t *resconf = NULL;
isc_sockaddrlist_t *nameservers;
isc_sockaddr_t *sa;
result = irs_resconf_load(dhcp_gbl_ctx.mctx, _PATH_RESOLV_CONF,
&resconf);
if (result != ISC_R_SUCCESS) {
log_error("irs_resconf_load failed: %d.", result);
return (result);
}
nameservers = irs_resconf_getnameservers(resconf);
/* Initialize port numbers */
for (sa = ISC_LIST_HEAD(*nameservers);
sa != NULL;
sa = ISC_LIST_NEXT(sa, link)) {
switch (sa->type.sa.sa_family) {
case AF_INET:
sa->type.sin.sin_port = htons(NS_DEFAULTPORT);
break;
case AF_INET6:
sa->type.sin6.sin6_port = htons(NS_DEFAULTPORT);
break;
default:
break;
}
}
result = dns_client_setservers(dhcp_gbl_ctx.dnsclient,
dns_rdataclass_in,
NULL, nameservers);
if (result != ISC_R_SUCCESS) {
log_error("dns_client_setservers failed: %d.",
result);
}
return (result);
}
#endif
void
isclib_cleanup(void)
{
@@ -142,6 +193,11 @@ dhcp_context_create(void) {
&dhcp_gbl_ctx.dnsclient);
if (result != ISC_R_SUCCESS)
goto cleanup;
result = dhcp_dns_client_setservers();
if (result != ISC_R_SUCCESS)
goto cleanup;
#else
/* The dst library is inited as part of dns_lib_init, we don't
* need it if NSUPDATE is enabled */