diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2014-02-24 18:28:55 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2014-11-04 08:45:04 -0700 |
commit | 39e3ece2b698760ff9454a5e4b780fd2ce0dad44 (patch) | |
tree | 2ad954ebff0aa13567375b0132d64d405c0393a3 | |
parent | e226badb960695447af4c480bb183ec35c411bbf (diff) | |
download | android_external_dnsmasq-39e3ece2b698760ff9454a5e4b780fd2ce0dad44.tar.gz android_external_dnsmasq-39e3ece2b698760ff9454a5e4b780fd2ce0dad44.tar.bz2 android_external_dnsmasq-39e3ece2b698760ff9454a5e4b780fd2ce0dad44.zip |
dnsmasq: Fix issues observed while toggling tethering
- When an instantaneous tether and untether command are issued,
the dnsmasq operation of tether happens after the interface
has been brought down by the untether command and hence
tethering goes into bad state. The fix is to leave dnsmasq
running so that it can be killed later by the untether command.
- 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 listeners
are updated with the new interface object
CRs-fixed: 665103
Change-Id: I0322619edc12146c67fa7a308769e3b9f0779654
-rw-r--r--[-rwxr-xr-x] | src/network.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/network.c b/src/network.c index f2ccf34..6a8a433 100755..100644 --- a/src/network.c +++ b/src/network.c @@ -961,7 +961,7 @@ void set_interfaces(const char *interfaces) for (if_tmp = daemon->if_names; if_tmp; if_tmp = if_tmp->next) { if (if_tmp->name && !if_tmp->used) { - die(_("unknown interface given %s in set_interfaces: %s"), if_tmp->name, EC_BADNET); + my_syslog(LOG_DEBUG, _("unknown interface given %s in set_interfaces"), if_tmp->name); } } /* success! - setup to free the old */ @@ -986,6 +986,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 */ |