All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] sit: do not report an error from ipip6_fill_info()
@ 2026-09-12  0:54 Eric Dumazet
  2026-09-12  5:47 ` luoxuanqiang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-09-12  0:54 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, David Ahern, Ido Schimmel, netdev, eric.dumazet,
	Eric Dumazet

ipip6_fill_info() returns -ENODEV if tunnel->sit_parms is NULL.

This can not happen yet: sit_parms is only cleared from
ipip6_dev_free(), the priv_destructor, which runs long after
RTM_DELLINK has been built.

Returning an error from a fill_info() handler is still a trap,
because rtnl_dump_ifinfo() stops at the first failure and propagates
it, letting one device hide all the remaining ones.

Return 0 instead, there is nothing to report for a device that is
going away.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv6/sit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 14ba3cfb304a83ee37e3be5b09a57c371f1977c3..a7ec800216ade169985d389ad1dc672f0358f4ee 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1853,9 +1853,10 @@ static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)
 
 	rcu_read_lock();
 	parm = rcu_dereference(tunnel->sit_parms);
+	/* If the device is being dismantled, there is nothing to report. */
 	if (!parm) {
 		rcu_read_unlock();
-		return -ENODEV;
+		return 0;
 	}
 
 	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
-- 
2.55.0.1007.g17ff1f9808-goog


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

* Re: [PATCH net-next] sit: do not report an error from ipip6_fill_info()
  2026-09-12  0:54 [PATCH net-next] sit: do not report an error from ipip6_fill_info() Eric Dumazet
@ 2026-09-12  5:47 ` luoxuanqiang
  2026-09-12 21:47 ` Lorenzo Bianconi
  2026-09-15  2:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: luoxuanqiang @ 2026-09-12  5:47 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Simon Horman, David Ahern, Ido Schimmel, netdev, eric.dumazet,
	David S . Miller, Jakub Kicinski, Paolo Abeni

在 2026/9/12 08:54, Eric Dumazet 写道:
> ipip6_fill_info() returns -ENODEV if tunnel->sit_parms is NULL.
> 
> This can not happen yet: sit_parms is only cleared from
> ipip6_dev_free(), the priv_destructor, which runs long after
> RTM_DELLINK has been built.
> 
> Returning an error from a fill_info() handler is still a trap,
> because rtnl_dump_ifinfo() stops at the first failure and propagates
> it, letting one device hide all the remaining ones.
> 
> Return 0 instead, there is nothing to report for a device that is
> going away.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>

Thanks,
Xuanqiang

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

* Re: [PATCH net-next] sit: do not report an error from ipip6_fill_info()
  2026-09-12  0:54 [PATCH net-next] sit: do not report an error from ipip6_fill_info() Eric Dumazet
  2026-09-12  5:47 ` luoxuanqiang
@ 2026-09-12 21:47 ` Lorenzo Bianconi
  2026-09-15  2:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2026-09-12 21:47 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
	David Ahern, Ido Schimmel, netdev, eric.dumazet

[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]

> ipip6_fill_info() returns -ENODEV if tunnel->sit_parms is NULL.
> 
> This can not happen yet: sit_parms is only cleared from
> ipip6_dev_free(), the priv_destructor, which runs long after
> RTM_DELLINK has been built.
> 
> Returning an error from a fill_info() handler is still a trap,
> because rtnl_dump_ifinfo() stops at the first failure and propagates
> it, letting one device hide all the remaining ones.
> 
> Return 0 instead, there is nothing to report for a device that is
> going away.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

> ---
>  net/ipv6/sit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index 14ba3cfb304a83ee37e3be5b09a57c371f1977c3..a7ec800216ade169985d389ad1dc672f0358f4ee 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -1853,9 +1853,10 @@ static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)
>  
>  	rcu_read_lock();
>  	parm = rcu_dereference(tunnel->sit_parms);
> +	/* If the device is being dismantled, there is nothing to report. */
>  	if (!parm) {
>  		rcu_read_unlock();
> -		return -ENODEV;
> +		return 0;
>  	}
>  
>  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
> -- 
> 2.55.0.1007.g17ff1f9808-goog
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next] sit: do not report an error from ipip6_fill_info()
  2026-09-12  0:54 [PATCH net-next] sit: do not report an error from ipip6_fill_info() Eric Dumazet
  2026-09-12  5:47 ` luoxuanqiang
  2026-09-12 21:47 ` Lorenzo Bianconi
@ 2026-09-15  2:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-15  2:10 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: davem, kuba, pabeni, horms, dsahern, idosch, netdev, eric.dumazet

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 12 Sep 2026 00:54:42 +0000 you wrote:
> ipip6_fill_info() returns -ENODEV if tunnel->sit_parms is NULL.
> 
> This can not happen yet: sit_parms is only cleared from
> ipip6_dev_free(), the priv_destructor, which runs long after
> RTM_DELLINK has been built.
> 
> Returning an error from a fill_info() handler is still a trap,
> because rtnl_dump_ifinfo() stops at the first failure and propagates
> it, letting one device hide all the remaining ones.
> 
> [...]

Here is the summary with links:
  - [net-next] sit: do not report an error from ipip6_fill_info()
    https://git.kernel.org/netdev/net-next/c/f7cd8d2dc74d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-09-15  2:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-12  0:54 [PATCH net-next] sit: do not report an error from ipip6_fill_info() Eric Dumazet
2026-09-12  5:47 ` luoxuanqiang
2026-09-12 21:47 ` Lorenzo Bianconi
2026-09-15  2:10 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.