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

* Re: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
  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
  1 sibling, 2 replies; 5+ messages in thread
From: Jussi Laakkonen @ 2021-11-22 15:10 UTC (permalink / raw)
  To: Christian Taedcke, connman

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

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

* Re: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
  2021-11-22 15:10 ` Jussi Laakkonen
@ 2021-11-26 16:33   ` Daniel Wagner
  2021-12-19 17:48   ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2021-11-26 16:33 UTC (permalink / raw)
  To: Jussi Laakkonen; +Cc: Christian Taedcke, connman

On Mon, Nov 22, 2021 at 05:10:09PM +0200, Jussi Laakkonen wrote:
> 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?

Good question. Need to dig into it when I am back from holiday :)

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

* Re: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
  2021-11-22 15:10 ` Jussi Laakkonen
  2021-11-26 16:33   ` Daniel Wagner
@ 2021-12-19 17:48   ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2021-12-19 17:48 UTC (permalink / raw)
  To: Jussi Laakkonen; +Cc: Christian Taedcke, connman

On Mon, Nov 22, 2021 at 05:10:09PM +0200, Jussi Laakkonen wrote:
> Good find. This indeed fixes this particular issue, IPv6 does seem to get
> disabled after removing a USB ethernet device. Surprising side effect.

Indeed :)

> 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?

As far I can tell, ConnMan is operating on per interface level (if using
this interface). So this should be okay.

I am going to apply the patch.
Daniel

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

* Re: [PATCH] ipconfig: Do not enable/disable ipv6 for all ifs
  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-12-19 17:49 ` Daniel Wagner
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2021-12-19 17:49 UTC (permalink / raw)
  To: connman, Christian Taedcke; +Cc: Daniel Wagner

On Mon, 22 Nov 2021 14:03:46 +0100, 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.
> 

Applied, thanks!

[1/1] ipconfig: Do not enable/disable ipv6 for all ifs
      commit: 53732ed09689736e6a06c48cfc0435a1e3eb1aa2

Best regards,
-- 
Daniel Wagner <wagi@monom.org>

^ permalink raw reply	[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).