From b5a8dd1dec325aa1d9ce733cd79b3e4941cbece7 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Mon, 10 Dec 2012 11:37:25 +0000 Subject: [PATCH] Fix FTBFS with NO_DHCP. --- CHANGELOG | 4 ++++ src/option.c | 36 ++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2a2c6c1..9ffc82e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,10 @@ version 2.65 TCP which are not for A and AAAA and which were directed to non-default servers. Thanks to Niax for the bug report. + Fix failure to build with DHCP support excluded. Thanks to + Gustavo Zacarias for the patch. + + version 2.64 Handle DHCP FQDN options with all flag bits zero and --dhcp-client-update set. Thanks to Bernd Krumbroeck for diff --git a/src/option.c b/src/option.c index c1643a1..3c7341b 100644 --- a/src/option.c +++ b/src/option.c @@ -623,24 +623,6 @@ static void do_usage(void) #define ret_err(x) do { strcpy(errstr, (x)); return 0; } while (0) -#ifdef HAVE_DHCP - -static int is_tag_prefix(char *arg) -{ - if (arg && (strstr(arg, "net:") == arg || strstr(arg, "tag:") == arg)) - return 1; - - return 0; -} - -static char *set_prefix(char *arg) -{ - if (strstr(arg, "set:") == arg) - return arg+4; - - return arg; -} - char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_addr, char *interface, int *flags) { int source_port = 0, serv_port = NAMESERVER_PORT; @@ -728,6 +710,24 @@ char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_a return NULL; } +#ifdef HAVE_DHCP + +static int is_tag_prefix(char *arg) +{ + if (arg && (strstr(arg, "net:") == arg || strstr(arg, "tag:") == arg)) + return 1; + + return 0; +} + +static char *set_prefix(char *arg) +{ + if (strstr(arg, "set:") == arg) + return arg+4; + + return arg; +} + /* This is too insanely large to keep in-line in the switch */ static int parse_dhcp_opt(char *errstr, char *arg, int flags) {