[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a561c3b-02dd-485a-aff0-04f1e347adf0@ovn.org>
Date: Thu, 11 Apr 2024 18:38:19 +0200
From: Ilya Maximets <i.maximets@....org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: i.maximets@....org, 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 4/11/24 17:52, Jakub Kicinski wrote:
> 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?
AFAICT, it dumps the family according to the tunnel configuration.
If ipsec is set up for IPv4, then it dumps IPv4, if v6 - v6.
> 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;
I tried that and IPv4 tests with Libreswan are passing with this change
on latest net-next/main.
IPv6 tests are stuck in the same way as IPv4 did before. The sendto
as captured by strace is following:
sendto(7, [
{
nlmsg_len=48, nlmsg_type=0x1a /* NLMSG_??? */,
nlmsg_flags=NLM_F_REQUEST|0x300, nlmsg_seq=0, nlmsg_pid=17084
},
"\x0a\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x01\x00\xfd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02"], 48, 0, NULL, 0) = 48
NLMSG_DONE is part of the first recvfrom and the process is stuck
waiting for something from the second one.
Best regards, Ilya Maximets.
Powered by blists - more mailing lists