connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jussi Laakkonen <jussi.laakkonen@jolla.com>
To: Christian Taedcke <christian.taedcke@lemonbeat.com>,
	connman@lists.linux.dev
Subject: Re: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
Date: Mon, 22 Nov 2021 17:10:09 +0200	[thread overview]
Message-ID: <eaf58704-04c3-b6be-54b9-88ef707f95d2@jolla.com> (raw)
In-Reply-To: <20211122130346.114768-1-christian.taedcke@lemonbeat.com>

Hi Christian,

On 11/22/21 3:03 PM, Christian Taedcke wrote:
> 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);
>   
> 

Good find. This indeed fixes this particular issue, IPv6 does seem to 
get disabled after removing a USB ethernet device. Surprising side effect.

With a quick glance I cannot see any problems related to this, I'm not 
100% sure if there is a case where this disable_ipv6() is used via 
__connman_ipconfig_disable_ipv6() to completely disable IPv6, Daniel?

Cheers,
  Jussi

  reply	other threads:[~2021-11-22 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 13:03 [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs Christian Taedcke
2021-11-22 15:10 ` Jussi Laakkonen [this message]
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=eaf58704-04c3-b6be-54b9-88ef707f95d2@jolla.com \
    --to=jussi.laakkonen@jolla.com \
    --cc=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).