diff options
author | Ido Schimmel <idosch@nvidia.com> | 2024-03-07 16:47:27 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-08 20:39:12 +0100 |
commit | 5d9b7cb383bb3228d72066c15206299858214f92 (patch) | |
tree | 6199ac13d65e4b655a1d4d34606aae43eb60f440 /net/ipv4/nexthop.c | |
parent | net: add skb_data_unref() helper (diff) | |
download | linux-5d9b7cb383bb3228d72066c15206299858214f92.tar.xz linux-5d9b7cb383bb3228d72066c15206299858214f92.zip |
nexthop: Simplify dump error handling
The only error that can happen during a nexthop dump is insufficient
space in the skb caring the netlink messages (EMSGSIZE). If this happens
and some messages were already filled in, the nexthop code returns the
skb length to signal the netlink core that more objects need to be
dumped.
After commit b5a899154aa9 ("netlink: handle EMSGSIZE errors in the
core") there is no need to handle this error in the nexthop code as it
is now handled in the core.
Simplify the code and simply return the error to the core.
No regressions in nexthop tests:
# ./fib_nexthops.sh
Tests passed: 234
Tests failed: 0
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240307154727.3555462-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/nexthop.c')
-rw-r--r-- | net/ipv4/nexthop.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index e34466751d7b..5eb3ba568f4e 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -3491,10 +3491,6 @@ static int rtm_dump_nexthop(struct sk_buff *skb, struct netlink_callback *cb) err = rtm_dump_walk_nexthops(skb, cb, root, ctx, &rtm_dump_nexthop_cb, &filter); - if (err < 0) { - if (likely(skb->len)) - err = skb->len; - } cb->seq = net->nexthop.seq; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); @@ -3688,11 +3684,6 @@ static int rtm_dump_nexthop_bucket(struct sk_buff *skb, &rtm_dump_nexthop_bucket_cb, &dd); } - if (err < 0) { - if (likely(skb->len)) - err = skb->len; - } - cb->seq = net->nexthop.seq; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); return err; |