diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-06-23 16:35:44 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-11-17 11:17:44 +0100 |
commit | 1e9044be8d4325fa82f01d72eb6c8581dcd6fd06 (patch) | |
tree | 587f2a6a425b6328de693f0e39bd79c0e4e82d47 /staticd/static_zebra.c | |
parent | Merge pull request #10071 from donaldsharp/valgrind_supp_change (diff) | |
download | frr-1e9044be8d4325fa82f01d72eb6c8581dcd6fd06.tar.xz frr-1e9044be8d4325fa82f01d72eb6c8581dcd6fd06.zip |
*: clean up ifp-by-local-address function(s)
Most users of if_lookup_address_exact only cared about whether the
address is any local address. Split that off into a separate function.
For the users that actually need the ifp - which I'm about to add a few
of - change it to prefer returning interfaces that are UP.
(Function name changed due to slight change in behavior re. UP state, to
avoid possible bugs from this change.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'staticd/static_zebra.c')
-rw-r--r-- | staticd/static_zebra.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index 538fae28a..38b3c93d7 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -162,14 +162,10 @@ static bool static_nexthop_is_local(vrf_id_t vrfid, struct prefix *addr, int family) { if (family == AF_INET) { - if (if_lookup_exact_address(&addr->u.prefix4, - AF_INET, - vrfid)) + if (if_address_is_local(&addr->u.prefix4, AF_INET, vrfid)) return true; } else if (family == AF_INET6) { - if (if_lookup_exact_address(&addr->u.prefix6, - AF_INET6, - vrfid)) + if (if_address_is_local(&addr->u.prefix6, AF_INET6, vrfid)) return true; } return false; |