diff options
author | Eric Dumazet <edumazet@google.com> | 2024-03-06 11:24:26 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-08 05:48:22 +0100 |
commit | 02e24903e5a46b7a7fca44bcfe0cd6fa5b240c34 (patch) | |
tree | edfd71bc7d022a0bc4af6570d19fa8a95e7621f1 /net/ipv4 | |
parent | selftests/net: fix waiting time for ipv6_gc test in fib_tests.sh. (diff) | |
download | linux-02e24903e5a46b7a7fca44bcfe0cd6fa5b240c34.tar.xz linux-02e24903e5a46b7a7fca44bcfe0cd6fa5b240c34.zip |
netlink: let core handle error cases in dump operations
After commit b5a899154aa9 ("netlink: handle EMSGSIZE errors
in the core"), we can remove some code that was not 100 % correct
anyway.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240306102426.245689-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/devinet.c | 4 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 7 |
2 files changed, 1 insertions, 10 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 4daa8124f247..7a437f0d4190 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1900,8 +1900,6 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) goto done; } done: - if (err < 0 && likely(skb->len)) - err = skb->len; if (fillargs.netnsid >= 0) put_net(tgt_net); rcu_read_unlock(); @@ -2312,8 +2310,6 @@ static int inet_netconf_dump_devconf(struct sk_buff *skb, ctx->all_default++; } done: - if (err < 0 && likely(skb->len)) - err = skb->len; rcu_read_unlock(); return err; } diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index bf3a2214fe29..48741352a88a 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1026,8 +1026,6 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) goto unlock; } err = fib_table_dump(tb, skb, cb, &filter); - if (err < 0 && skb->len) - err = skb->len; goto unlock; } @@ -1045,11 +1043,8 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) memset(&cb->args[2], 0, sizeof(cb->args) - 2 * sizeof(cb->args[0])); err = fib_table_dump(tb, skb, cb, &filter); - if (err < 0) { - if (likely(skb->len)) - err = skb->len; + if (err < 0) goto out; - } dumped = 1; next: e++; |