|
|
85f98a |
From 7e3250d52921b5f75bdbe0b794514bb78a209969 Mon Sep 17 00:00:00 2001
|
|
|
85f98a |
From: Petr Mensik <pemensik@redhat.com>
|
|
|
85f98a |
Date: Wed, 3 Jul 2019 17:02:16 +0200
|
|
|
85f98a |
Subject: [PATCH 2/5] Compare address and interface index for allowed interface
|
|
|
85f98a |
|
|
|
85f98a |
If interface is recreated with the same address but different index, it
|
|
|
85f98a |
would not change any other parameter.
|
|
|
85f98a |
|
|
|
85f98a |
Test also address family on incoming TCP queries.
|
|
|
85f98a |
---
|
|
|
85f98a |
src/dnsmasq.c | 3 ++-
|
|
|
85f98a |
src/network.c | 3 ++-
|
|
|
85f98a |
2 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
85f98a |
|
|
|
85f98a |
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
|
|
|
85f98a |
index f3d2671..7812be8 100644
|
|
|
85f98a |
--- a/src/dnsmasq.c
|
|
|
85f98a |
+++ b/src/dnsmasq.c
|
|
|
85f98a |
@@ -1667,7 +1667,8 @@ static void check_dns_listeners(time_t now)
|
|
|
85f98a |
#endif
|
|
|
85f98a |
|
|
|
85f98a |
for (iface = daemon->interfaces; iface; iface = iface->next)
|
|
|
85f98a |
- if (iface->index == if_index)
|
|
|
85f98a |
+ if (iface->index == if_index &&
|
|
|
85f98a |
+ iface->addr.sa.sa_family == tcp_addr.sa.sa_family)
|
|
|
85f98a |
break;
|
|
|
85f98a |
|
|
|
85f98a |
if (!iface && !loopback_exception(listener->tcpfd, tcp_addr.sa.sa_family, &addr, intr_name))
|
|
|
85f98a |
diff --git a/src/network.c b/src/network.c
|
|
|
85f98a |
index fd90288..f247811 100644
|
|
|
85f98a |
--- a/src/network.c
|
|
|
85f98a |
+++ b/src/network.c
|
|
|
85f98a |
@@ -404,10 +404,11 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
|
|
|
85f98a |
/* check whether the interface IP has been added already
|
|
|
85f98a |
we call this routine multiple times. */
|
|
|
85f98a |
for (iface = daemon->interfaces; iface; iface = iface->next)
|
|
|
85f98a |
- if (sockaddr_isequal(&iface->addr, addr))
|
|
|
85f98a |
+ if (sockaddr_isequal(&iface->addr, addr) && iface->index == if_index)
|
|
|
85f98a |
{
|
|
|
85f98a |
iface->dad = !!(iface_flags & IFACE_TENTATIVE);
|
|
|
85f98a |
iface->found = 1; /* for garbage collection */
|
|
|
85f98a |
+ iface->netmask = netmask;
|
|
|
85f98a |
return 1;
|
|
|
85f98a |
}
|
|
|
85f98a |
|
|
|
85f98a |
--
|
|
|
85f98a |
2.20.1
|
|
|
85f98a |
|