Following scenario is possible:
- we have a wifi service A connected and IPv6 is enabled for it
- we connect to other IPv6 enabled service B
- the first service is disconnected
- kernel sends rtnl messages related to events that are done
when we connect/disconnect the services
- if A service's link down event is received after we have
received B's link up, then we will remove the ipv6 config
from service B
- this has the effect that IPv6 addresses are not known by
service B any more
So when we receive a reply to router solicitation message,
we check if the IPv6 config is still there in service B.
If it is not, then we can create it so that service gets
the IPv6 config back.
The missing IPv6 config can only happen if we are switching
from one service to another. If we disconnect first service A
and then connect service B, no issues were seen.
---
src/network.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/network.c b/src/network.c
index d3ad83b..baf7ba4 100644
--- a/src/network.c
+++ b/src/network.c
@@ -464,6 +464,7 @@ static void check_dhcpv6(struct nd_router_advert *reply,
unsigned int length, void *user_data)
{
struct connman_network *network = user_data;
+ struct connman_service *service;
GSList *prefixes;
DBG("reply %p", reply);
@@ -499,6 +500,23 @@ static void check_dhcpv6(struct nd_router_advert *reply,
prefixes = __connman_inet_ipv6_get_prefixes(reply, length);
/*
+ * If IPv6 config is missing from service, then create it.
+ * The ipconfig might be missing if we got a rtnl message
+ * that disabled IPv6 config and thus removed it. This
+ * can happen if we are switching from one service to
+ * another in the same interface. The only way to get IPv6
+ * config back is to re-create it here.
+ */
+ service = connman_service_lookup_from_network(network);
+ if (service) {
+ connman_service_create_ip6config(service, network->index);
+
+ __connman_service_ipconfig_indicate_state(service,
+ CONNMAN_SERVICE_STATE_CONFIGURATION,
+ CONNMAN_IPCONFIG_TYPE_IPV6);
+ }
+
+ /*
* We do stateful/stateless DHCPv6 if router advertisement says so.
*/
if (reply->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED)
--
1.8.3.1
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman