public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Gal Pressman <gal.pressman@linux.dev>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Stefano Brivio <sbrivio@redhat.com>,
	davem@davemloft.net, netdev@vger.kernel.org, pabeni@redhat.com,
	jiri@resnulli.us, johannes@sipsolutions.net, fw@strlen.de,
	pablo@netfilter.org, Martin Pitt <mpitt@redhat.com>,
	Paul Holzinger <pholzing@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH net-next v2 3/3] genetlink: fit NLMSG_DONE into same read() as families
Date: Thu, 21 Mar 2024 15:51:28 +0200	[thread overview]
Message-ID: <Zfw7YB4nZrquW4Bo@shredder> (raw)
In-Reply-To: <7e261328-42eb-411d-b1b4-ad884eeaae4d@linux.dev>

On Thu, Mar 21, 2024 at 02:56:41PM +0200, Gal Pressman wrote:
> We've encountered a new issue recently which I believe is related to
> this discussion.
> 
> Following Eric's patch:
> 9cc4cc329d30 ("ipv6: use xa_array iterator to implement inet6_dump_addr()")
> 
> Setting the interface mtu to < 1280 results in 'ip addr show eth2'
> returning an error, because the ipv6 dump fails. This is a degradation
> from the user's perspective.
> 
> # ip addr show eth2
> 4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> default qlen 1000
>     link/ether 24:42:53:21:52:44 brd ff:ff:ff:ff:ff:ff
>     altname enp6s0f0np0
> # ip link set dev eth2 mtu 1000
> # ip addr show eth2
> RTNETLINK answers: No such device
> Dump terminated

I don't think it's the same issue. Original issue was about user space
not knowing how to handle NLMSG_DONE being sent together with dump
responses. The issue you reported seems to be related to an
unintentional change in the return code when IPv6 is disabled on an
interface. Can you please test the following patch?

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 247bd4d8ee45..92db9b474f2b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5416,10 +5416,11 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
 
                err = 0;
                if (fillargs.ifindex) {
-                       err = -ENODEV;
                        dev = dev_get_by_index_rcu(tgt_net, fillargs.ifindex);
-                       if (!dev)
+                       if (!dev) {
+                               err = -ENODEV;
                                goto done;
+                       }
                        idev = __in6_dev_get(dev);
                        if (idev)
                                err = in6_dump_addrs(idev, skb, cb,

  reply	other threads:[~2024-03-21 13:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03  5:24 [PATCH net-next v2 0/3] netlink: handle EMSGSIZE errors in the core Jakub Kicinski
2024-03-03  5:24 ` [PATCH net-next v2 1/3] " Jakub Kicinski
2024-03-03 15:01   ` Ido Schimmel
2024-03-03  5:24 ` [PATCH net-next v2 2/3] netdev: let netlink core handle -EMSGSIZE errors Jakub Kicinski
2024-03-03 15:08   ` Ido Schimmel
2024-03-03  5:24 ` [PATCH net-next v2 3/3] genetlink: fit NLMSG_DONE into same read() as families Jakub Kicinski
2024-03-03 15:10   ` Ido Schimmel
2024-03-15 11:48   ` Stefano Brivio
2024-03-19 15:55     ` Jakub Kicinski
2024-03-19 17:17       ` Eric Dumazet
2024-03-19 17:40         ` Jakub Kicinski
2024-03-21 12:56           ` Gal Pressman
2024-03-21 13:51             ` Ido Schimmel [this message]
2024-03-21 15:03               ` Gal Pressman
2024-03-21 17:26               ` Eric Dumazet
2024-03-21 17:41                 ` Ido Schimmel
2024-04-03 22:52           ` Ilya Maximets
2024-04-11 15:16             ` Jakub Kicinski
2024-04-11 15:39               ` Ilya Maximets
2024-04-11 15:52                 ` Jakub Kicinski
2024-04-11 16:38                   ` Ilya Maximets
2024-04-11 18:03                     ` Jakub Kicinski
2024-04-11 18:04                       ` Jakub Kicinski
2024-03-19 23:36       ` David Gibson
2024-03-06  8:10 ` [PATCH net-next v2 0/3] netlink: handle EMSGSIZE errors in the core patchwork-bot+netdevbpf

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=Zfw7YB4nZrquW4Bo@shredder \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=david@gibson.dropbear.id.au \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=gal.pressman@linux.dev \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=mpitt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=pholzing@redhat.com \
    --cc=sbrivio@redhat.com \
    /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