mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Merge branch 'master' into dnssec
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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;
|
||||
|
||||
10
src/option.c
10
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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user