diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-30 07:56:24 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-30 07:56:24 -0400 |
| commit | e55a43d491c8423feceb6c37b8d42d8b1637a0e5 (patch) | |
| tree | 6b47f3df16729685965ece63c92c14b6c801a488 /pimd/pim_iface.c | |
| parent | 7f432a28e08bef5aaa75a830161f893adb9b3577 (diff) | |
pimd: Remove expensive lookup for if a device is a vrf device
Interfaces know if they are a vrf device or not and this data
is passed up to the protocol.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_iface.c')
| -rw-r--r-- | pimd/pim_iface.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index e58d81591d..5996a3ac96 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1555,16 +1555,12 @@ bool pim_if_is_loopback(struct interface *ifp) return false; } -int pim_if_is_vrf_device(struct interface *ifp) +bool pim_if_is_vrf_device(struct interface *ifp) { - struct vrf *vrf; - - RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { - if (strncmp(ifp->name, vrf->name, strlen(ifp->name)) == 0) - return 1; - } + if (if_is_vrf(ifp)) + return true; - return 0; + return false; } int pim_if_ifchannel_count(struct pim_interface *pim_ifp) |
