diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-31 16:43:36 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-31 16:47:00 -0400 |
| commit | ff3745c26abdfbebeebf14ffe55361666771e1a7 (patch) | |
| tree | ff24d60ebc1aaca943a3110ef9908e4b4c5863ee /pimd/pim_nht.c | |
| parent | 8cb129e9868eb5edb7bfe98917fad9931de6144b (diff) | |
pimd: Remove impossible conditions from test
It is impossible for the list->cmp function to
ever be handed NULL values as the arguments.
Clean up this in the code.
Additionally consolidate the exact same two functions
into 1 function.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_nht.c')
| -rw-r--r-- | pimd/pim_nht.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index 5395c08392..fe96d01a06 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -111,42 +111,6 @@ pim_nexthop_cache_find (struct pim_rpf *rpf) } -static int -pim_rp_list_cmp (void *v1, void *v2) -{ - struct rp_info *rp1 = (struct rp_info *) v1; - struct rp_info *rp2 = (struct rp_info *) v2; - - if (rp1 == rp2) - return 0; - - if (!rp1 && rp2) - return -1; - - if (rp1 && !rp2) - return 1; - - /* - * Sort by RP IP address - */ - if (rp1->rp.rpf_addr.u.prefix4.s_addr < rp2->rp.rpf_addr.u.prefix4.s_addr) - return -1; - - if (rp1->rp.rpf_addr.u.prefix4.s_addr > rp2->rp.rpf_addr.u.prefix4.s_addr) - return 1; - - /* - * Sort by group IP address - */ - if (rp1->group.u.prefix4.s_addr < rp2->group.u.prefix4.s_addr) - return -1; - - if (rp1->group.u.prefix4.s_addr > rp2->group.u.prefix4.s_addr) - return 1; - - return -1; -} - struct pim_nexthop_cache * pim_nexthop_cache_add (struct pim_rpf *rpf_addr) { |
