connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Christian Taedcke <christian.taedcke@lemonbeat.com>
To: connman@lists.linux.dev
Cc: Christian Taedcke <christian.taedcke@lemonbeat.com>
Subject: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
Date: Mon, 22 Nov 2021 14:03:46 +0100	[thread overview]
Message-ID: <20211122130346.114768-1-christian.taedcke@lemonbeat.com> (raw)

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


             reply	other threads:[~2021-11-22 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 13:03 Christian Taedcke [this message]
2021-11-22 15:10 ` [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs Jussi Laakkonen
2021-11-26 16:33   ` Daniel Wagner
2021-12-19 17:48   ` Daniel Wagner
2021-12-19 17:49 ` Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211122130346.114768-1-christian.taedcke@lemonbeat.com \
    --to=christian.taedcke@lemonbeat.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).