]> git.dujemihanovic.xyz Git - linux.git/commitdiff
rtnetlink: change rtnl_stats_dump() return value
authorEric Dumazet <edumazet@google.com>
Thu, 2 May 2024 11:37:47 +0000 (11:37 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 3 May 2024 22:03:42 +0000 (15:03 -0700)
By returning 0 (or an error) instead of skb->len,
we allow NLMSG_DONE to be appended to the current
skb at the end of a dump, saving a couple of recvmsg()
system calls.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240502113748.1622637-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/rtnetlink.c

index 283e42f48af68504af193ed5763d4e0fcd667d99..88980c8bcf334079e2d19cbcfb3f10fc05e3c19b 100644 (file)
@@ -6024,7 +6024,7 @@ out:
        cb->args[1] = idx;
        cb->args[0] = h;
 
-       return skb->len;
+       return err;
 }
 
 void rtnl_offload_xstats_notify(struct net_device *dev)