diff --git a/CHANGELOG b/CHANGELOG index 39dbe17..785eea4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,9 @@ version 2.69 on the BSD platform. Thanks to Matthias Andree for valuable research on how to implement this. + Fix infinite loop associated with some --bogus-nxdomain + configs. Thanks fogobogo for the bug report. + version 2.68 Use random addresses for DHCPv6 temporary address diff --git a/src/dhcp-common.c b/src/dhcp-common.c index a92d728..3f9979e 100644 --- a/src/dhcp-common.c +++ b/src/dhcp-common.c @@ -399,13 +399,13 @@ void dhcp_update_configs(struct dhcp_config *configs) if (cache_find_by_name(crec, config->hostname, 0, cacheflags)) { /* use primary (first) address */ - while (crec && !(crec->flags & F_REVERSE)) - crec = cache_find_by_name(crec, config->hostname, 0, cacheflags); - if (!crec) - continue; /* should be never */ - inet_ntop(prot, &crec->addr.addr, daemon->addrbuff, ADDRSTRLEN); - my_syslog(MS_DHCP | LOG_WARNING, _("%s has more than one address in hostsfile, using %s for DHCP"), - config->hostname, daemon->addrbuff); + while (crec && !(crec->flags & F_REVERSE)) + crec = cache_find_by_name(crec, config->hostname, 0, cacheflags); + if (!crec) + continue; /* should be never */ + inet_ntop(prot, &crec->addr.addr, daemon->addrbuff, ADDRSTRLEN); + my_syslog(MS_DHCP | LOG_WARNING, _("%s has more than one address in hostsfile, using %s for DHCP"), + config->hostname, daemon->addrbuff); } if (prot == AF_INET && diff --git a/src/dnsmasq.h b/src/dnsmasq.h index bde72e2..241f9a5 100644 --- a/src/dnsmasq.h +++ b/src/dnsmasq.h @@ -581,7 +581,7 @@ struct dhcp_lease { struct in6_addr addr6; int iaid; struct slaac_address { - struct in6_addr addr, local; + struct in6_addr addr; time_t ping_time; int backoff; /* zero -> confirmed */ struct slaac_address *next; diff --git a/src/option.c b/src/option.c index edc3ae4..cadabd5 100644 --- a/src/option.c +++ b/src/option.c @@ -2737,7 +2737,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma else { char *cp, *lastp = NULL, last = 0; - int fac = 1; + int fac = 1, isdig = 0; if (strlen(a[j]) > 1) { @@ -2768,9 +2768,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma } for (cp = a[j]; *cp; cp++) - if (!isdigit((unsigned char)*cp) && *cp != ' ') + if (isdigit((unsigned char)*cp)) + isdig = 1; + else if (*cp != ' ') break; - + if (*cp) { if (lastp) @@ -2792,7 +2794,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma new->domain = strip_hostname(new->hostname); } } - else + else if (isdig) { new->lease_time = atoi(a[j]) * fac; /* Leases of a minute or less confuse diff --git a/src/rfc1035.c b/src/rfc1035.c index 7321d96..ab0b239 100644 --- a/src/rfc1035.c +++ b/src/rfc1035.c @@ -1299,7 +1299,7 @@ int check_for_bogus_wildcard(struct dns_header *header, size_t qlen, char *name, /* Found a bogus address. Insert that info here, since there no SOA record to get the ttl from in the normal processing */ cache_start_insert(); - cache_insert(name, NULL, now, ttl, F_IPV4 | F_FORWARD | F_NEG | F_NXDOMAIN | F_CONFIG); + cache_insert(name, NULL, now, ttl, F_IPV4 | F_FORWARD | F_NEG | F_NXDOMAIN); cache_end_insert(); return 1; diff --git a/src/slaac.c b/src/slaac.c index 43c2c38..7eb4236 100644 --- a/src/slaac.c +++ b/src/slaac.c @@ -93,7 +93,6 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force) slaac->ping_time = now; slaac->backoff = 1; slaac->addr = addr; - slaac->local = context->local6; /* Do RA's to prod it */ ra_start_unsolicted(now, context); }