From: Pasi Sjöholm <[email protected]>

Nameservers need to be cleaned after
disconnecting so that they are not reused when
pdp-protocol e.g. changes from ipv6 to dual/ipv4v6.
---
 plugins/ofono.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index b60e7ba..16d8257 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -325,10 +325,16 @@ static void set_disconnected(struct modem_data *modem)
 {
        DBG("%s", modem->path);
 
-       if (!modem->network)
-               return;
+       if (modem->network)
+               connman_network_set_connected(modem->network, false);
 
-       connman_network_set_connected(modem->network, false);
+       if (modem->context) {
+               g_free(modem->context->ipv4_nameservers);
+               modem->context->ipv4_nameservers = NULL;
+
+               g_free(modem->context->ipv6_nameservers);
+               modem->context->ipv6_nameservers = NULL;
+       }
 }
 
 typedef void (*set_property_cb)(struct modem_data *data,
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to