summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatish Kamuju <skamuj@codeaurora.org>2014-01-08 19:24:35 +0530
committerSteve Kondik <shade@chemlab.org>2014-05-06 12:50:40 -0700
commit3340f260d2511b106c585ca24b8f1a7b0c407a6d (patch)
treed31fa0ebb6f631dd2bfa441bdb4304f7f4e5e200
parente0957c9686600aa6fa75f66884e85accdadafb33 (diff)
downloadandroid_external_dnsmasq-3340f260d2511b106c585ca24b8f1a7b0c407a6d.tar.gz
android_external_dnsmasq-3340f260d2511b106c585ca24b8f1a7b0c407a6d.tar.bz2
android_external_dnsmasq-3340f260d2511b106c585ca24b8f1a7b0c407a6d.zip
dnsmasq: Update listeners when interface set changes
dnsmasq does not update its list of listeners with the new interface object whenver an interface goes up/down and hence when we free the old interface objects, the interface info in dnsmasq listeners is lost. This fix makes sure the listenerss are updated with the new interface object Change-Id: Ib3204d0d94c28a57f473fc04c5a10a52fc48e754 CRs-Fixed: 586287
-rwxr-xr-xsrc/network.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index c734e43..3923c2e 100755
--- a/src/network.c
+++ b/src/network.c
@@ -956,6 +956,21 @@ void set_interfaces(const char *interfaces)
close_bound_listener(old_iface);
}
+ else
+ {
+ struct listener **l, *listener;
+ for (l = &(daemon->listeners); *l; l = &((*l)->next)) {
+ struct irec *listener_iface = (*l)->iface;
+ if (listener_iface && new_iface) {
+ if (sockaddr_isequal(&listener_iface->addr, &new_iface->addr)) {
+ break;
+ }
+ }
+ }
+ listener = *l;
+ if ( listener )
+ listener->iface = new_iface;
+ }
}
/* remove wildchar listeners */