]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Hnadle dhcpv6 being disabled better
authorShawn Routhier <sar@isc.org>
Tue, 12 Jan 2016 20:33:26 +0000 (12:33 -0800)
committerShawn Routhier <sar@isc.org>
Tue, 12 Jan 2016 20:33:26 +0000 (12:33 -0800)
    The previous patches didn't handle dhvpv6 being disabled well.
    This change moves the #ifdefs a bit to handle it.

RELNOTES
client/dhclient.c
relay/dhcrelay.c
server/tests/simple_unittest.c

index 17e8bc6df5c44b441fc20a85a49cff26f22f3e10..55ee8dbb54d78ce653cd33285cebf6505435cdc8 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -136,6 +136,7 @@ by Eric Young (eay@cryptsoft.com).
   print out a specific error message about the first error in addition
   to the usage string.  This may be disabled by editing includes/site.h.
   [ISC-Bugs #40321]
+  [ISC-Bugs #41454]
 
 - The configure script will now exit with an error message if it cannot find
   a GNU-style make tool (needed when building BIND libraries) or pkg-config
index 7a4ee1eb8b82d77244af1c29868e24d4662c5ef7..df7f8836e930d2451afba0d864d9af2698345bc0 100644 (file)
@@ -71,10 +71,12 @@ int std_dhcid = 0;
    assert (state_is == state_shouldbe). */
 #define ASSERT_STATE(state_is, state_shouldbe) {}
 
+#ifndef UNIT_TEST
 static const char copyright[] = "Copyright 2004-2015 Internet Systems Consortium.";
 static const char arr [] = "All rights reserved.";
 static const char message [] = "Internet Systems Consortium DHCP Client";
 static const char url [] = "For info, please visit https://www.isc.org/software/dhcp/";
+#endif /* UNIT_TEST */
 
 u_int16_t local_port = 0;
 u_int16_t remote_port = 0;
@@ -129,8 +131,9 @@ static void dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb,
  * which isn't compiled when building for unit tests
  */
 static const char use_noarg[] = "No argument for command: %s";
+#ifdef DHCPv6
 static const char use_v6command[] = "Command not used for DHCPv4: %s";
-#endif /* !UNIT_TEST */
+#endif
 
 static void
 usage(const char *sfmt, const char *sarg)
@@ -159,7 +162,6 @@ usage(const char *sfmt, const char *sarg)
                  isc_file_basename(progname));
 }
 
-#ifndef UNIT_TEST
 int
 main(int argc, char **argv) {
        int fd;
@@ -810,7 +812,6 @@ main(int argc, char **argv) {
        /* In fact dispatch() never returns. */
        return 0;
 }
-#endif /* !UNIT_TEST */
 
 void run_stateless(int exit_mode)
 {
@@ -899,6 +900,7 @@ void run_stateless(int exit_mode)
 #endif /* DHCPv6 */
        return;
 }
+#endif /* !UNIT_TEST */
 
 isc_result_t find_class (struct class **c,
                const char *s, const char *file, int line)
index 6095ebcf2948fe8bff7ae7264b57ba406c99638c..e50032b8a9035d99abba9460c4edc474d9be6953 100644 (file)
@@ -183,9 +183,11 @@ char *progname;
  * \return Nothing
  */
 static const char use_noarg[] = "No argument for command: %s";
+#ifdef DHCPv6
 static const char use_badproto[] = "Protocol already set, %s inappropriate";
 static const char use_v4command[] = "Command not used for DHCPv6: %s";
 static const char use_v6command[] = "Command not used for DHCPv4: %s";
+#endif
 
 static void
 usage(const char *sfmt, const char *sarg) {
index 5e1db91972f1a6773f6db836c2e2111ec95ec02d..c345aefdcf4962663350818481cf0657f31708ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2012,2015-2016 Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -67,7 +67,7 @@ ATF_TC_BODY(simple_test_case, tc)
 
 }
 
-
+#ifdef DHCPv6
 ATF_TC(parse_byte_order);
 
 ATF_TC_HEAD(parse_byte_order, tc)
@@ -110,7 +110,7 @@ ATF_TC_BODY(parse_byte_order, tc)
 
     atf_tc_pass();
 }
-
+#endif /*  DHCPv6 */
 
 /* This macro defines main() method that will call specified
    test cases. tp and simple_test_case names can be whatever you want
@@ -118,7 +118,8 @@ ATF_TC_BODY(parse_byte_order, tc)
 ATF_TP_ADD_TCS(tp)
 {
     ATF_TP_ADD_TC(tp, simple_test_case);
+#ifdef DHCPv6
     ATF_TP_ADD_TC(tp, parse_byte_order);
-
+#endif
     return (atf_no_error());
 }