nexthop: Simplify dump error handling
authorIdo Schimmel <idosch@nvidia.com>
Thu, 7 Mar 2024 15:47:27 +0000 (17:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Mar 2024 19:39:12 +0000 (11:39 -0800)
commit5d9b7cb383bb3228d72066c15206299858214f92
tree6199ac13d65e4b655a1d4d34606aae43eb60f440
parent1cface552a5b5f6e53a855de1a503ff958e2e253
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>
net/ipv4/nexthop.c