[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411085206.1d127414@kernel.org>
Date: Thu, 11 Apr 2024 08:52:06 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Ilya Maximets <i.maximets@....org>
Cc: Eric Dumazet <edumazet@...gle.com>, Stefano Brivio <sbrivio@...hat.com>,
davem@...emloft.net, netdev@...r.kernel.org, pabeni@...hat.com,
jiri@...nulli.us, idosch@...sch.org, johannes@...solutions.net,
fw@...len.de, pablo@...filter.org, Martin Pitt <mpitt@...hat.com>, Paul
Holzinger <pholzing@...hat.com>, David Gibson <david@...son.dropbear.id.au>
Subject: Re: [PATCH net-next v2 3/3] genetlink: fit NLMSG_DONE into same
read() as families
On Thu, 11 Apr 2024 17:39:20 +0200 Ilya Maximets wrote:
> nlmsg_type=0x1a /* NLMSG_??? */ --> RTM_GETROUTE
> nlmsg_flags=NLM_F_REQUEST|0x300 --> NLM_F_REQUEST|NLM_F_DUMP
Thanks!
Also:
"\x02\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x01\x00\x0a\x01\x01\x02"
^^^^
So it's dumping AF_INET. I'm guessing its also going to dump v6,
separately? To fix v4 I think something like this would do (untested):
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 48741352a88a..749baa74eee7 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1050,6 +1050,11 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
e++;
}
}
+
+ /* Don't let NLM_DONE coalesce into a message, even if it could.
+ * Some user space expects NLM_DONE in a separate recv().
+ */
+ err = skb->len;
out:
cb->args[1] = e;
Powered by blists - more mailing lists