dhcp-host selection fix for v4/v6
diff --git a/src/rfc1035.c b/src/rfc1035.c
index 7c1c30d..c1dc716 100644
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -644,20 +644,20 @@
int len;
void *addrp;
- if (source->sa.sa_family == AF_INET)
- {
- opt->family = htons(1);
- opt->source_netmask = daemon->addr4_netmask;
- addrp = &source->in.sin_addr;
- }
#ifdef HAVE_IPV6
- else
+ if (source->sa.sa_family == AF_INET6)
{
opt->family = htons(2);
opt->source_netmask = daemon->addr6_netmask;
addrp = &source->in6.sin6_addr;
}
+ else
#endif
+ {
+ opt->family = htons(1);
+ opt->source_netmask = daemon->addr4_netmask;
+ addrp = &source->in.sin_addr;
+ }
opt->scope_netmask = 0;
len = 0;