mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-23 10:28:08 +00:00
[master] Hnadle dhcpv6 being disabled better
The previous patches didn't handle dhvpv6 being disabled well. This change moves the #ifdefs a bit to handle it.
This commit is contained in:
parent
75ab52e12b
commit
eda1d0aa5a
1
RELNOTES
1
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
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user