diff options
author | sarita patra <saritap@vmware.com> | 2022-03-16 11:08:53 +0100 |
---|---|---|
committer | Sarita Patra <saritap@vmware.com> | 2022-07-07 19:56:45 +0200 |
commit | 1407e40fc89812341f2dabc4d8a3105cefb3793f (patch) | |
tree | e92b13076841d12ed0b78df77353e5ab5e42a57a /pimd/pim_bsm.c | |
parent | pim6d: add pimv6 support for bsm_hdr (diff) | |
download | frr-1407e40fc89812341f2dabc4d8a3105cefb3793f.tar.xz frr-1407e40fc89812341f2dabc4d8a3105cefb3793f.zip |
pim6d: add pimv6 support for bsmmsg_rpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
Diffstat (limited to 'pimd/pim_bsm.c')
-rw-r--r-- | pimd/pim_bsm.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index 480445f20..ea6149569 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -130,11 +130,7 @@ int pim_bsm_rpinfo_cmp(const struct bsm_rpinfo *node1, return 1; if (node1->hash > node2->hash) return -1; - if (pim_addr_cmp(node1->rp_address, node2->rp_address) < 0) - return 1; - if (pim_addr_cmp(node1->rp_address, node2->rp_address) > 0) - return -1; - return 0; + return pim_addr_cmp(node2->rp_address, node1->rp_address); } static struct bsgrp_node *pim_bsm_new_bsgrp_node(struct route_table *rt, @@ -1058,6 +1054,7 @@ static uint32_t hash_calc_on_grp_rp(struct prefix group, struct in_addr rp, grpaddr = grpaddr & ((mask << (32 - hashmasklen))); else grpaddr = grpaddr & mask; + rp_add = ntohl(rp.s_addr); temp = 1103515245 * ((1103515245 * (uint64_t)grpaddr + 12345) ^ rp_add) + 12345; @@ -1077,8 +1074,7 @@ static bool pim_install_bsm_grp_rp(struct pim_instance *pim, bsm_rpinfo->rp_prio = rp->rp_pri; bsm_rpinfo->rp_holdtime = rp->rp_holdtime; - memcpy(&bsm_rpinfo->rp_address, &rp->rpaddr.addr, - sizeof(struct in_addr)); + bsm_rpinfo->rp_address = rp->rpaddr.addr; bsm_rpinfo->elapse_time = 0; /* Back pointer to the group node. */ @@ -1243,13 +1239,12 @@ static bool pim_bsm_parse_install_g2rp(struct bsm_scope *scope, uint8_t *buf, offset += sizeof(struct bsmmsg_rpinfo); if (PIM_DEBUG_BSM) { - char rp_str[INET_ADDRSTRLEN]; + pim_addr rp_addr; - pim_inet4_dump("<Rpaddr?>", rpinfo.rpaddr.addr, - rp_str, sizeof(rp_str)); + rp_addr = rpinfo.rpaddr.addr; zlog_debug( - "%s, Rp address - %s; pri:%d hold:%d", - __func__, rp_str, rpinfo.rp_pri, + "%s, Rp address - %pPAs; pri:%d hold:%d", + __func__, &rp_addr, rpinfo.rp_pri, rpinfo.rp_holdtime); } |