diff options
author | Sarita Patra <saritap@vmware.com> | 2023-01-23 06:10:45 +0100 |
---|---|---|
committer | Sarita Patra <saritap@vmware.com> | 2023-02-24 13:40:38 +0100 |
commit | 3dbf370ac0a7cb0f10c56c37286adf971215dff1 (patch) | |
tree | c9905855a1f63c0653437b53381fcd797157afe4 /pimd | |
parent | zebra: Send nexthop ifindex for type NEXTHOP_TYPE_IPV6 (diff) | |
download | frr-3dbf370ac0a7cb0f10c56c37286adf971215dff1.tar.xz frr-3dbf370ac0a7cb0f10c56c37286adf971215dff1.zip |
pimd,pim6d: Modify pim_neighbor_find() API
Modify pim_neighbor_find() API to find the neighbor
in neighbor secondary list.
Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_cmd_common.c | 2 | ||||
-rw-r--r-- | pimd/pim_hello.c | 2 | ||||
-rw-r--r-- | pimd/pim_neighbor.c | 9 | ||||
-rw-r--r-- | pimd/pim_neighbor.h | 2 | ||||
-rw-r--r-- | pimd/pim_pim.c | 4 |
5 files changed, 13 insertions, 6 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index c7b501ee1..75df09ec3 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -1385,7 +1385,7 @@ void pim_show_upstream(struct pim_instance *pim, struct vty *vty, nbr = pim_neighbor_find( up->rpf.source_nexthop.interface, - up->rpf.rpf_addr); + up->rpf.rpf_addr, false); if (nbr) pim_time_timer_to_hhmmss(join_timer, sizeof(join_timer), diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c index 8d1924741..978607d14 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -277,7 +277,7 @@ int pim_hello_recv(struct interface *ifp, pim_addr src_addr, uint8_t *tlv_buf, New neighbor? */ - neigh = pim_neighbor_find(ifp, src_addr); + neigh = pim_neighbor_find(ifp, src_addr, false); if (!neigh) { /* Add as new neighbor */ diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 9edc3c1af..0b7ea0ad9 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -406,7 +406,7 @@ struct pim_neighbor *pim_neighbor_find_by_secondary(struct interface *ifp, } struct pim_neighbor *pim_neighbor_find(struct interface *ifp, - pim_addr source_addr) + pim_addr source_addr, bool secondary) { struct pim_interface *pim_ifp; struct listnode *node; @@ -425,6 +425,13 @@ struct pim_neighbor *pim_neighbor_find(struct interface *ifp, } } + if (secondary) { + struct prefix p; + + pim_addr_to_prefix(&p, source_addr); + return pim_neighbor_find_by_secondary(ifp, &p); + } + return NULL; } diff --git a/pimd/pim_neighbor.h b/pimd/pim_neighbor.h index e00f99fe2..f7375745a 100644 --- a/pimd/pim_neighbor.h +++ b/pimd/pim_neighbor.h @@ -38,7 +38,7 @@ struct pim_neighbor { void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime); void pim_neighbor_free(struct pim_neighbor *neigh); struct pim_neighbor *pim_neighbor_find(struct interface *ifp, - pim_addr source_addr); + pim_addr source_addr, bool secondary); struct pim_neighbor *pim_neighbor_find_by_secondary(struct interface *ifp, struct prefix *src); struct pim_neighbor *pim_neighbor_find_if(struct interface *ifp); diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index a7a8b0575..1248db3de 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -289,7 +289,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len, pim_msg_len - PIM_MSG_HEADER_LEN); break; case PIM_MSG_TYPE_JOIN_PRUNE: - neigh = pim_neighbor_find(ifp, sg.src); + neigh = pim_neighbor_find(ifp, sg.src, false); if (!neigh) { if (PIM_DEBUG_PIM_PACKETS) zlog_debug( @@ -304,7 +304,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len, pim_msg_len - PIM_MSG_HEADER_LEN); break; case PIM_MSG_TYPE_ASSERT: - neigh = pim_neighbor_find(ifp, sg.src); + neigh = pim_neighbor_find(ifp, sg.src, false); if (!neigh) { if (PIM_DEBUG_PIM_PACKETS) zlog_debug( |