genetlink: fit NLMSG_DONE into same read() as families
authorJakub Kicinski <kuba@kernel.org>
Sun, 3 Mar 2024 05:24:08 +0000 (21:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Mar 2024 08:07:45 +0000 (08:07 +0000)
commit87d381973e49404f658d6923a617932eeda9415f
tree8069890c728fffcb03b85d354c5cb5b76a3b5a2c
parent0b11b1c5c320555483e8a94c44549db24c289987
genetlink: fit NLMSG_DONE into same read() as families

Make sure ctrl_fill_info() returns sensible error codes and
propagate them out to netlink core. Let netlink core decide
when to return skb->len and when to treat the exit as an
error. Netlink core does better job at it, if we always
return skb->len the core doesn't know when we're done
dumping and NLMSG_DONE ends up in a separate read().

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/genetlink.c