]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Add #ifdefs to allow code to compile if NSUPDATE isn't defined
authorShawn Routhier <sar@isc.org>
Mon, 28 Apr 2014 22:27:02 +0000 (15:27 -0700)
committerShawn Routhier <sar@isc.org>
Mon, 28 Apr 2014 22:27:02 +0000 (15:27 -0700)
RELNOTES
common/tests/dns_unittest.c
omapip/isclib.c
server/dhcpd.c
server/failover.c

index 3960563dd46991a4f5697d5542bf17a915ff3c26..89d7561c837e3f3824e7c28871171c2cc9b5f1ab 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -77,6 +77,9 @@ by Eric Young (eay@cryptsoft.com).
 - Fix some minor issues in the dst code.
   [ISC-Bugs #34172]
 
+- Properly #ifdef functions so that the code can compile without NSUPDATE
+  [ISC-Bugs #35058]
+
                        Changes since 4.3.0rc1
 
 - None
index 7bc537dab6e37c4dc96fea4160f1630ccea72066..0236f667421df0cf33dc5421f1e6af9cf62ff5f9 100644 (file)
@@ -31,6 +31,8 @@
  * from rfc 4701
  */
 
+#if defined (NSUPDATE)
+
 char *name_1 = "chi6.example.com"; 
 u_int8_t clid_1[] = {0x00, 0x01, 0x00, 0x06, 0x41, 0x2d, 0xf1, 0x66, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
 u_int8_t std_result_1[] = {0x00, 0x02, 0x01, 0x63, 0x6f, 0xc0, 0xb8, 0x27, 0x1c,
@@ -173,3 +175,19 @@ ATF_TP_ADD_TCS(tp)
 
     return (atf_no_error());
 }
+
+#else /* NSUPDATE */
+ATF_TC(untested);
+ATF_TC_HEAD(untested, tc) {
+    atf_tc_set_md_var(tc, "descr", "skipping dns test");
+}
+ATF_TC_BODY(untested, tc) {
+    IGNORE_UNUSED(tc);
+    atf_tc_skip("NSUPDATE is not defined");
+}
+ATF_TP_ADD_TCS(tp) {
+    ATF_TP_ADD_TC(tp, untested);
+
+    return (atf_no_error());
+}
+#endif /* NSUPDATE */
index 671b321ba5d831bb89d88d3e9780792b9880add8..59332ed9b241255bd060e02108edc26888acb3cc 100644 (file)
@@ -144,6 +144,15 @@ dhcp_context_create(int flags,
                gettimeofday(&cur_tv, (struct timezone *)0);
                isc_random_seed(cur_tv.tv_sec);
 
+               /* we need to create the memory context before
+                * the lib inits in case we aren't doing NSUPDATE
+                * in which case dst needs a memory context
+                */
+               result = isc_mem_create(0, 0, &dhcp_gbl_ctx.mctx);
+               if (result != ISC_R_SUCCESS)
+                       goto cleanup;
+
+
 #if defined (NSUPDATE)
                result = dns_lib_init();
                if (result != ISC_R_SUCCESS)
@@ -156,9 +165,6 @@ dhcp_context_create(int flags,
                        goto cleanup;
 
 #endif
-               result = isc_mem_create(0, 0, &dhcp_gbl_ctx.mctx);
-               if (result != ISC_R_SUCCESS)
-                       goto cleanup;
 
                result = isc_appctx_create(dhcp_gbl_ctx.mctx,
                                           &dhcp_gbl_ctx.actx);
index a06913ee23538bd6495ef6688b759db0489e1ad3..2ae031e6fc672b003bab5f8f1b304d4adc0477c2 100644 (file)
@@ -412,7 +412,9 @@ main(int argc, char **argv) {
        trace_srandom = trace_type_register ("random-seed", (void *)0,
                                             trace_seed_input,
                                             trace_seed_stop, MDL);
+#if defined (NSUPDATE)
        trace_ddns_init();
+#endif /* NSUPDATE */
 #endif
 
 #if defined (PARANOIA)
index 618bdc62d6067f5c4cc6298eee61e85eb6f58790..96ee1774e731d873536566cd7dd7107973d567b4 100644 (file)
@@ -5222,7 +5222,9 @@ isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *state,
         */
        if (msg->binding_status == FTS_ACTIVE &&
            (chaddr_changed || ident_changed)) {
+#if defined (NSUPDATE)
                (void) ddns_removals(lease, NULL, NULL, ISC_FALSE);
+#endif /* NSUPDATE */
 
                if (lease->scope != NULL)
                        binding_scope_dereference(&lease->scope, MDL);