diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-30 07:50:08 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-30 07:53:01 -0400 |
| commit | 7f432a28e08bef5aaa75a830161f893adb9b3577 (patch) | |
| tree | 558c03a41282c7fd2d30f25f1ff998d7a72cfba8 /pimd/pim_iface.c | |
| parent | 397123370bad8084d5cdfd49224c1cce50f9de5f (diff) | |
pimd: Cleanup pim_if_is_loopback
The interface itself knows if it is a vrf device or
not, so let's just use a check for that in the decision
if a interface is a loopback or not.
Additionally modify function to return a bool.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_iface.c')
| -rw-r--r-- | pimd/pim_iface.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index ff7238ae97..e58d81591d 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1547,15 +1547,12 @@ int pim_if_connected_to_source(struct interface *ifp, struct in_addr src) return 0; } -int pim_if_is_loopback(struct pim_instance *pim, struct interface *ifp) +bool pim_if_is_loopback(struct interface *ifp) { - if (if_is_loopback(ifp)) - return 1; - - if (strcmp(ifp->name, pim->vrf->name) == 0) - return 1; + if (if_is_loopback(ifp) || if_is_vrf(ifp)) + return true; - return 0; + return false; } int pim_if_is_vrf_device(struct interface *ifp) |
