connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
@ 2021-11-22 13:03 Christian Taedcke
  2021-11-22 15:10 ` Jussi Laakkonen
  2021-12-19 17:49 ` Daniel Wagner
  0 siblings, 2 replies; 5+ messages in thread
From: Christian Taedcke @ 2021-11-22 13:03 UTC (permalink / raw)
  To: connman; +Cc: Christian Taedcke

If the interface name could not be determined (e.g. because the usb
device was unplugged and removed from the system), do not disable ipv6
for all devices.
---
 src/ipconfig.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/ipconfig.c b/src/ipconfig.c
index 1551826b..34b1724a 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1593,6 +1593,9 @@ static void disable_ipv6(struct connman_ipconfig *ipconfig)
 
 	ifname = connman_inet_ifname(ipconfig->index);
 
+	if (!ifname)
+	        return;
+
 	set_ipv6_state(ifname, false);
 
 	g_free(ifname);
@@ -1612,6 +1615,9 @@ static void enable_ipv6(struct connman_ipconfig *ipconfig)
 
 	ifname = connman_inet_ifname(ipconfig->index);
 
+	if (!ifname)
+	        return;
+
 	if (ipconfig->method == CONNMAN_IPCONFIG_METHOD_AUTO)
 		set_ipv6_privacy(ifname, ipconfig->ipv6_privacy_config);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-19 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 13:03 [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs Christian Taedcke
2021-11-22 15:10 ` Jussi Laakkonen
2021-11-26 16:33   ` Daniel Wagner
2021-12-19 17:48   ` Daniel Wagner
2021-12-19 17:49 ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).