Make --listen-address higher priority than --except-interface.

This commit is contained in:
Simon Kelley
2013-07-29 17:21:48 +01:00
parent 8d03046269
commit edf0bde0c6
2 changed files with 10 additions and 6 deletions

View File

@@ -92,6 +92,9 @@ version 2.67
Add --force-fast-ra option. Another thanks to Uwe Schindler. Add --force-fast-ra option. Another thanks to Uwe Schindler.
Make --listen-address higher priority than --except-interface
in all circumstances. Thanks to Thomas Hood for the bugreport.
version 2.66 version 2.66
Add the ability to act as an authoritative DNS Add the ability to act as an authoritative DNS

View File

@@ -112,7 +112,7 @@ int indextoname(int fd, int index, char *name)
int iface_check(int family, struct all_addr *addr, char *name, int *auth) int iface_check(int family, struct all_addr *addr, char *name, int *auth)
{ {
struct iname *tmp; struct iname *tmp;
int ret = 1; int ret = 1, match_addr = 0;
/* Note: have to check all and not bail out early, so that we set the /* Note: have to check all and not bail out early, so that we set the
"used" flags. */ "used" flags. */
@@ -134,16 +134,17 @@ int iface_check(int family, struct all_addr *addr, char *name, int *auth)
{ {
if (family == AF_INET && if (family == AF_INET &&
tmp->addr.in.sin_addr.s_addr == addr->addr.addr4.s_addr) tmp->addr.in.sin_addr.s_addr == addr->addr.addr4.s_addr)
ret = tmp->used = 1; ret = match_addr = tmp->used = 1;
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
else if (family == AF_INET6 && else if (family == AF_INET6 &&
IN6_ARE_ADDR_EQUAL(&tmp->addr.in6.sin6_addr, IN6_ARE_ADDR_EQUAL(&tmp->addr.in6.sin6_addr,
&addr->addr.addr6)) &addr->addr.addr6))
ret = tmp->used = 1; ret = match_addr = tmp->used = 1;
#endif #endif
} }
} }
if (!match_addr)
for (tmp = daemon->if_except; tmp; tmp = tmp->next) for (tmp = daemon->if_except; tmp; tmp = tmp->next)
if (tmp->name && wildcard_match(tmp->name, name)) if (tmp->name && wildcard_match(tmp->name, name))
ret = 0; ret = 0;