Skip to content

Commit

Permalink
nexthop: set errno when lookup add fails
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Jarry <rjarry@redhat.com>
  • Loading branch information
rjarry committed Jun 1, 2024
1 parent c572f91 commit 666bc46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ip/control/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int ip4_nexthop_lookup_add(uint16_t vrf_id, ip4_addr_t ip, uint32_t *idx, struct
struct nexthop_key key = {vrf_id, ip};
int32_t nh_idx = rte_hash_add_key(nh_hash, &key);
if (nh_idx < 0)
return nh_idx;
return errno_set(-nh_idx);
nh_array[nh_idx].vrf_id = vrf_id;
nh_array[nh_idx].ip = ip;
*idx = nh_idx;
Expand Down

0 comments on commit 666bc46

Please sign in to comment.