diff options
| author | Russ White <russ@riw.us> | 2022-12-27 14:51:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-27 14:51:28 -0500 |
| commit | 16aa1809e7c8caad37e8edd4e5aaac4f344bc7d3 (patch) | |
| tree | dee0b8f0b0a4fc2387af5433b213cad845c9dd66 /lib/if.c | |
| parent | f616e716089b16d9a678846282a6ac5c55e31a56 (diff) | |
| parent | ce82e9026056e5aa7f60abdbf975d19a7fffc623 (diff) | |
Merge pull request #11127 from louis-6wind/bgp-leak
bgpd: multiple fixes for route leaking
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -564,9 +564,24 @@ size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz, return count; } +/* Get the VRF loopback interface, i.e. the loopback on the default VRF + * or the VRF interface. + */ +struct interface *if_get_vrf_loopback(vrf_id_t vrf_id) +{ + struct interface *ifp = NULL; + struct vrf *vrf = vrf_lookup_by_id(vrf_id); + + FOR_ALL_INTERFACES (vrf, ifp) + if (if_is_loopback(ifp)) + return ifp; + + return NULL; +} /* Get interface by name if given name interface doesn't exist create - one. */ + * one. + */ struct interface *if_get_by_name(const char *name, vrf_id_t vrf_id, const char *vrf_name) { |
