From: Yu Watanabe Date: Thu, 28 Nov 2024 19:05:58 +0000 (+0900) Subject: network/nexthop: replace unreachable condition with assertion X-Git-Tag: v258-rc1~1883^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=246b0a4d26dce8b713a73ccf9ce5ec7837a6939f;p=thirdparty%2Fsystemd.git network/nexthop: replace unreachable condition with assertion --- diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 7aa7bd6f6d7..18b130b9599 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -420,8 +420,7 @@ static int nexthop_add_new(Manager *manager, uint32_t id, NextHop **ret) { r = hashmap_ensure_put(&manager->nexthops_by_id, &nexthop_hash_ops, UINT32_TO_PTR(nexthop->id), nexthop); if (r < 0) return r; - if (r == 0) - return -EEXIST; + assert(r > 0); nexthop->manager = manager;