diff options
Diffstat (limited to 'src/edns0.c')
-rw-r--r-- | src/edns0.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/edns0.c b/src/edns0.c index af33877..d75d3cc 100644 --- a/src/edns0.c +++ b/src/edns0.c @@ -1,4 +1,4 @@ -/* dnsmasq is Copyright (c) 2000-2018 Simon Kelley +/* dnsmasq is Copyright (c) 2000-2020 Simon Kelley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -301,20 +301,14 @@ static size_t add_mac(struct dns_header *header, size_t plen, unsigned char *lim struct subnet_opt { u16 family; - u8 source_netmask, scope_netmask; -#ifdef HAVE_IPV6 + u8 source_netmask, scope_netmask; u8 addr[IN6ADDRSZ]; -#else - u8 addr[INADDRSZ]; -#endif }; static void *get_addrp(union mysockaddr *addr, const short family) { -#ifdef HAVE_IPV6 if (family == AF_INET6) return &addr->in6.sin6_addr; -#endif return &addr->in.sin_addr; } @@ -330,7 +324,6 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source) opt->source_netmask = 0; opt->scope_netmask = 0; -#ifdef HAVE_IPV6 if (source->sa.sa_family == AF_INET6 && daemon->add_subnet6) { opt->source_netmask = daemon->add_subnet6->mask; @@ -342,7 +335,6 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source) else addrp = &source->in6.sin6_addr; } -#endif if (source->sa.sa_family == AF_INET && daemon->add_subnet4) { @@ -356,11 +348,7 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source) addrp = &source->in.sin_addr; } -#ifdef HAVE_IPV6 opt->family = htons(sa_family == AF_INET6 ? 2 : 1); -#else - opt->family = htons(1); -#endif len = 0; |