mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 10:38:05 +00:00
pimd: Tweak pim_ifchannel_compare to be faster
Tweak the ifchannel compare to sort based upon interface first Ticket: CM-15629 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
b5e6281b65
commit
e3a55f03bf
@ -50,6 +50,15 @@ pim_ifchannel_compare (struct pim_ifchannel *ch1, struct pim_ifchannel *ch2)
|
||||
struct pim_interface *pim_ifp1;
|
||||
struct pim_interface *pim_ifp2;
|
||||
|
||||
pim_ifp1 = ch1->interface->info;
|
||||
pim_ifp2 = ch2->interface->info;
|
||||
|
||||
if (pim_ifp1->mroute_vif_index < pim_ifp2->mroute_vif_index)
|
||||
return -1;
|
||||
|
||||
if (pim_ifp1->mroute_vif_index > pim_ifp2->mroute_vif_index)
|
||||
return 1;
|
||||
|
||||
if (ntohl(ch1->sg.grp.s_addr) < ntohl(ch2->sg.grp.s_addr))
|
||||
return -1;
|
||||
|
||||
@ -62,20 +71,6 @@ pim_ifchannel_compare (struct pim_ifchannel *ch1, struct pim_ifchannel *ch2)
|
||||
if (ntohl(ch1->sg.src.s_addr) > ntohl(ch2->sg.src.s_addr))
|
||||
return 1;
|
||||
|
||||
pim_ifp1 = ch1->interface->info;
|
||||
pim_ifp2 = ch2->interface->info;
|
||||
if (ntohl(pim_ifp1->primary_address.s_addr) < ntohl(pim_ifp2->primary_address.s_addr))
|
||||
return -1;
|
||||
|
||||
if (ntohl(pim_ifp1->primary_address.s_addr) > ntohl(pim_ifp2->primary_address.s_addr))
|
||||
return 1;
|
||||
|
||||
if (pim_ifp1->mroute_vif_index < pim_ifp2->mroute_vif_index)
|
||||
return -1;
|
||||
|
||||
if (pim_ifp1->mroute_vif_index > pim_ifp2->mroute_vif_index)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user