From d58395d1f37e01faaf1b6124647243ccfdf6a134 Mon Sep 17 00:00:00 2001 From: sarita patra Date: Thu, 28 Apr 2022 03:27:42 -0700 Subject: [PATCH 1/2] pim6d: Adjust IPV6 secondary address list Within one Address List Hello option, all the addresses MUST be of the same address family. It is not permitted to mix IPv4 and IPv6 addresses within the same message. In addition, the address family of the fields in the message SHOULD be the same as the IP source and destination addresses of the packet header. Signed-off-by: sarita patra --- pimd/pim_neighbor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 84b532d345..00902396b2 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -715,7 +715,7 @@ static void delete_from_neigh_addr(struct interface *ifp, struct listnode *neigh_node; struct pim_neighbor *neigh; - if (addr->family != AF_INET) + if (addr->family != PIM_AF) continue; /* From 53749ba70baa9011c4f5c21f7f9a43d1dd330dde Mon Sep 17 00:00:00 2001 From: sarita patra Date: Thu, 28 Apr 2022 03:28:17 -0700 Subject: [PATCH 2/2] pimd: Print secondary address using %pFX Signed-off-by: sarita patra --- pimd/pim_neighbor.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 00902396b2..0dedbf9b3e 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -362,19 +362,16 @@ static void delete_prefix_list(struct pim_neighbor *neigh) #ifdef DUMP_PREFIX_LIST struct listnode *p_node; struct prefix *p; - char addr_str[10]; int list_size = neigh->prefix_list ? (int)listcount(neigh->prefix_list) : -1; int i = 0; for (ALL_LIST_ELEMENTS_RO(neigh->prefix_list, p_node, p)) { - pim_inet4_dump("", p->u.prefix4, addr_str, - sizeof(addr_str)); zlog_debug( - "%s: DUMP_PREFIX_LIST neigh=%x prefix_list=%x prefix=%x addr=%s [%d/%d]", + "%s: DUMP_PREFIX_LIST neigh=%x prefix_list=%x prefix=%x addr=%pFXh [%d/%d]", __func__, (unsigned)neigh, - (unsigned)neigh->prefix_list, (unsigned)p, - addr_str, i, list_size); + (unsigned)neigh->prefix_list, (unsigned)p, p, i, + list_size); ++i; } #endif @@ -717,7 +714,6 @@ static void delete_from_neigh_addr(struct interface *ifp, if (addr->family != PIM_AF) continue; - /* Scan neighbors */ @@ -727,15 +723,9 @@ static void delete_from_neigh_addr(struct interface *ifp, struct prefix *p = pim_neighbor_find_secondary( neigh, addr); if (p) { - char addr_str[INET_ADDRSTRLEN]; - - pim_inet4_dump( - "", addr->u.prefix4, - addr_str, sizeof(addr_str)); - zlog_info( - "secondary addr %s recvd from neigh %pPA deleted from neigh %pPA on %s", - addr_str, &neigh_addr, + "secondary addr %pFXh recvd from neigh %pPA deleted from neigh %pPA on %s", + addr, &neigh_addr, &neigh->source_addr, ifp->name); listnode_delete(neigh->prefix_list, p);