mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix hang from new interface-name code, when using TCP.
This commit is contained in:
@@ -1362,6 +1362,19 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure that the interface list is up-to-date.
|
||||||
|
|
||||||
|
We do this here as we may need the results below, and
|
||||||
|
the DNS code needs them for --interface-name stuff.
|
||||||
|
|
||||||
|
Multiple calls to enumerate_interfaces() per select loop are
|
||||||
|
inhibited, so calls to it in the child process (which doesn't select())
|
||||||
|
have no effect. This avoids two processes reading from the same
|
||||||
|
netlink fd and screwing the pooch entirely.
|
||||||
|
*/
|
||||||
|
|
||||||
|
enumerate_interfaces(0);
|
||||||
|
|
||||||
if (option_bool(OPT_NOWILD))
|
if (option_bool(OPT_NOWILD))
|
||||||
iface = listener->iface; /* May be NULL */
|
iface = listener->iface; /* May be NULL */
|
||||||
else
|
else
|
||||||
@@ -1369,11 +1382,6 @@ static void check_dns_listeners(fd_set *set, time_t now)
|
|||||||
int if_index;
|
int if_index;
|
||||||
char intr_name[IF_NAMESIZE];
|
char intr_name[IF_NAMESIZE];
|
||||||
|
|
||||||
/* In full wildcard mode, need to refresh interface list.
|
|
||||||
This happens automagically in CLEVERBIND */
|
|
||||||
if (!option_bool(OPT_CLEVERBIND))
|
|
||||||
enumerate_interfaces(0);
|
|
||||||
|
|
||||||
/* if we can find the arrival interface, check it's one that's allowed */
|
/* if we can find the arrival interface, check it's one that's allowed */
|
||||||
if ((if_index = tcp_interface(confd, tcp_addr.sa.sa_family)) != 0 &&
|
if ((if_index = tcp_interface(confd, tcp_addr.sa.sa_family)) != 0 &&
|
||||||
indextoname(listener->tcpfd, if_index, intr_name))
|
indextoname(listener->tcpfd, if_index, intr_name))
|
||||||
|
|||||||
@@ -438,7 +438,9 @@ int enumerate_interfaces(int reset)
|
|||||||
struct addrlist *addr, *tmp;
|
struct addrlist *addr, *tmp;
|
||||||
struct interface_name *intname;
|
struct interface_name *intname;
|
||||||
|
|
||||||
/* DO this max once per select cycle */
|
/* Do this max once per select cycle - also inhibits netlink socket use
|
||||||
|
in TCP child processes. */
|
||||||
|
|
||||||
if (reset)
|
if (reset)
|
||||||
{
|
{
|
||||||
done = 0;
|
done = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user