Commit ddb508ac authored by Thomas Markwalder's avatar Thomas Markwalder

[master] Fixed compilation error when NSUPDATE is undefined

    Merge branch '16-a-nsupdate-compiling-issue-was-observed'
parents 684111f9 650ae59e
......@@ -117,6 +117,10 @@ by Eric Young (eay@cryptsoft.com).
from BlueCat Networks for reporting this issue.
[ISC-Bugs #1, !2 git 9ef78585440f568da2a2a0093a8c40c49118e292]
- Corrected a compilation issue that occurred when building without DNS
update ability (e.g. by undefining NSUPDATE).
[ISC-Bugs, #16,!9 git #TBD]
Changes since 4.4.0 (New Features)
- none
Changes since 4.4.0 (Bug Fixes)
......
......@@ -3,7 +3,7 @@
DHCP Client. */
/*
* Copyright (c) 2004-2018 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2019 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* This Source Code Form is subject to the terms of the Mozilla Public
......@@ -120,8 +120,11 @@ static int check_domain_name_list(const char *ptr, size_t len, int dots);
static int check_option_values(struct universe *universe, unsigned int opt,
const char *ptr, size_t len);
#if defined(NSUPDATE)
static void dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb,
char* file, int line);
#endif /* defined NSUPDATE */
/*!
*
......@@ -1573,7 +1576,8 @@ void bind_lease (client)
#if defined (NSUPDATE)
if (client->config->do_forward_update)
dhclient_schedule_updates(client, &client->active->address, 1);
#endif
#endif /* defined NSUPDATE */
}
/* state_bound is called when we've successfully bound to a particular
......@@ -4799,7 +4803,8 @@ client_dns_remove(struct client_state *client,
}
}
}
#endif
#endif /* defined NSUPDATE */
isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
control_object_state_t newstate)
......@@ -4840,7 +4845,8 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
client_dns_remove(client,
&client->active->address);
}
#endif
#endif /* defined NSUPDATE */
do_release (client);
}
break;
......@@ -5187,7 +5193,7 @@ dhclient_schedule_updates(struct client_state *client,
piaddr(*addr));
}
}
#endif
#endif /* defined NSUPDATE */
void
dhcpv4_client_assignments(void)
......@@ -5382,6 +5388,7 @@ add_reject(struct packet *packet) {
log_info("Server added to list of rejected servers.");
}
#if defined(NSUPDATE)
/* Wrapper function around common ddns_cb_free function that ensures
* we set the client_state pointer to the control block to NULL. */
static void
......@@ -5395,6 +5402,7 @@ dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb, char* file, int line) {
ddns_cb_free(ddns_cb, file, line);
}
}
#endif /* defined NSUPDATE */
#if defined(DHCPv6) && defined(DHCP4o6)
/*
......
......@@ -3,7 +3,7 @@
connections to the isc and dns libraries */
/*
* Copyright (c) 2009-2017 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009-2019 by Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -141,6 +141,9 @@ void isclib_cleanup(void);
void dhcp_signal_handler(int signal);
extern int shutdown_signal;
#if defined (NSUPDATE)
isc_result_t dns_client_init();
#endif /* defined NSUPDATE */
#endif /* ISCLIB_H */
/*
* Copyright(c) 2009-2017 by Internet Systems Consortium, Inc.("ISC")
* Copyright(c) 2009-2019 by Internet Systems Consortium, Inc.("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -82,7 +82,7 @@ dhcp_dns_client_setservers(void)
}
return (result);
}
#endif
#endif /* defined NSUPDATE */
void
isclib_cleanup(void)
......@@ -90,7 +90,7 @@ isclib_cleanup(void)
#if defined (NSUPDATE)
if (dhcp_gbl_ctx.dnsclient != NULL)
dns_client_destroy((dns_client_t **)&dhcp_gbl_ctx.dnsclient);
#endif
#endif /* defined NSUPDATE */
if (dhcp_gbl_ctx.task != NULL) {
isc_task_shutdown(dhcp_gbl_ctx.task);
......@@ -171,14 +171,14 @@ dhcp_context_create(int flags,
result = dns_lib_init();
if (result != ISC_R_SUCCESS)
goto cleanup;
#else
#else /* defined NSUPDATE */
/* The dst library is inited as part of dns_lib_init, we don't
* need it if NSUPDATE is enabled */
result = dst_lib_init(dhcp_gbl_ctx.mctx, NULL, 0);
if (result != ISC_R_SUCCESS)
goto cleanup;
#endif
#endif /* defined NSUPDATE */
result = isc_appctx_create(dhcp_gbl_ctx.mctx,
&dhcp_gbl_ctx.actx);
......@@ -246,7 +246,7 @@ dhcp_context_create(int flags,
result = dns_client_init();
}
}
#endif
#endif /* defined NSUPDATE */
return(ISC_R_SUCCESS);
......@@ -351,6 +351,7 @@ void dhcp_signal_handler(int signal) {
}
}
#if defined (NSUPDATE)
isc_result_t dns_client_init() {
isc_result_t result;
if (dhcp_gbl_ctx.dnsclient == NULL) {
......@@ -387,3 +388,4 @@ isc_result_t dns_client_init() {
return ISC_R_SUCCESS;
}
#endif /* defined (NSUPDATE) */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment