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.
Moving c42d37d566061422e7c36408090d672c6df80c73 to approriate
place too.
---
plugins/ofono.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c
index b60e7ba..ecc40dc 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -325,10 +325,22 @@ 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) {
+ connman_ipaddress_free(modem->context->ipv4_address);
+ modem->context->ipv4_address = NULL;
+ modem->context->index = -1;
+ g_free(modem->context->ipv4_nameservers);
+ modem->context->ipv4_nameservers = NULL;
+
+ connman_ipaddress_free(modem->context->ipv6_address);
+ modem->context->ipv6_address = NULL;
+ modem->context->index = -1;
+ g_free(modem->context->ipv6_nameservers);
+ modem->context->ipv6_nameservers = NULL;
+ }
}
typedef void (*set_property_cb)(struct modem_data *data,
@@ -755,10 +767,6 @@ static void extract_ipv4_settings(DBusMessageIter *array,
const char *interface = NULL;
int index = -1;
- connman_ipaddress_free(context->ipv4_address);
- context->ipv4_address = NULL;
- context->index = -1;
-
if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY)
return;
@@ -861,10 +869,6 @@ static void extract_ipv6_settings(DBusMessageIter *array,
const char *interface = NULL;
int index = -1;
- connman_ipaddress_free(context->ipv6_address);
- context->ipv6_address = NULL;
- context->index = -1;
-
if (dbus_message_iter_get_arg_type(array) != DBUS_TYPE_ARRAY)
return;
--
2.1.0
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman