diff options
Diffstat (limited to 'pimd')
| -rw-r--r-- | pimd/pim_bfd.c | 2 | ||||
| -rw-r--r-- | pimd/pim_bsm.c | 3 | ||||
| -rw-r--r-- | pimd/pim_cmd.c | 14 | ||||
| -rw-r--r-- | pimd/pim_iface.c | 2 | ||||
| -rw-r--r-- | pimd/pim_ifchannel.c | 9 | ||||
| -rw-r--r-- | pimd/pim_igmp.c | 4 | ||||
| -rw-r--r-- | pimd/pim_igmp_mtrace.c | 53 | ||||
| -rw-r--r-- | pimd/pim_mlag.c | 8 | ||||
| -rw-r--r-- | pimd/pim_mlag.h | 1 | ||||
| -rw-r--r-- | pimd/pim_rp.c | 3 | ||||
| -rw-r--r-- | pimd/pim_rpf.c | 4 | ||||
| -rw-r--r-- | pimd/pimd.c | 2 | ||||
| -rw-r--r-- | pimd/subdir.am | 6 |
13 files changed, 53 insertions, 58 deletions
diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c index 0df8ea6922..146b53fa8f 100644 --- a/pimd/pim_bfd.c +++ b/pimd/pim_bfd.c @@ -194,7 +194,7 @@ void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx, if (!pim_ifp) return; - bfd_set_param(&(pim_ifp->bfd_info), min_rx, min_tx, detect_mult, + bfd_set_param(&(pim_ifp->bfd_info), min_rx, min_tx, detect_mult, NULL, defaults, &command); if (pim_ifp->bfd_info) { diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index d949c657bd..1c9005588f 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -1283,8 +1283,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf, pim_inet4_dump("<bsr?>", bshdr->bsr_addr.addr, bsr_str, sizeof(bsr_str)); if (bshdr->hm_len > 32) { - zlog_warn("Bad hashmask length for IPv4; got %" PRIu8 - ", expected value in range 0-32", + zlog_warn("Bad hashmask length for IPv4; got %hhu, expected value in range 0-32", bshdr->hm_len); pim->bsm_dropped++; return -1; diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 6919ed9a6d..db3f0b8b23 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -4979,8 +4979,7 @@ static void pim_show_mlag_help_string(struct vty *vty, bool uj) if (!uj) { vty_out(vty, "Owner codes:\n"); vty_out(vty, - "L: EVPN-MLAG Entry, I:PIM-MLAG Entry, " - "P: Peer Entry\n"); + "L: EVPN-MLAG Entry, I:PIM-MLAG Entry, P: Peer Entry\n"); } } @@ -6785,12 +6784,13 @@ static int pim_rp_cmd_worker(struct pim_instance *pim, struct vty *vty, if (result == PIM_GROUP_BAD_ADDR_MASK_COMBO) { vty_out(vty, "%% Inconsistent address and mask: %s\n", - group); + group ? group : "No Group Address"); return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_BAD_ADDRESS) { - vty_out(vty, "%% Bad group address specified: %s\n", group); + vty_out(vty, "%% Bad group address specified: %s\n", + group ? group : "No Group Address"); return CMD_WARNING_CONFIG_FAILED; } @@ -7159,7 +7159,8 @@ static int pim_no_rp_cmd_worker(struct pim_instance *pim, struct vty *vty, int result = pim_rp_del_config(pim, rp, group, plist); if (result == PIM_GROUP_BAD_ADDRESS) { - vty_out(vty, "%% Bad group address specified: %s\n", group); + vty_out(vty, "%% Bad group address specified: %s\n", + group ? group : "No Group Address"); return CMD_WARNING_CONFIG_FAILED; } @@ -8404,8 +8405,7 @@ DEFUN_HIDDEN (interface_ip_pim_ssm, } vty_out(vty, - "WARN: Enabled PIM SM on interface; configure PIM SSM " - "range if needed\n"); + "WARN: Enabled PIM SM on interface; configure PIM SSM range if needed\n"); return CMD_SUCCESS; } diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index b79fb689dc..88bcc48f80 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -341,7 +341,7 @@ pim_sec_addr_find(struct pim_interface *pim_ifp, struct prefix *addr) struct listnode *node; for (ALL_LIST_ELEMENTS_RO(pim_ifp->sec_addr_list, node, sec_addr)) { - if (prefix_cmp(&sec_addr->addr, addr)) { + if (prefix_cmp(&sec_addr->addr, addr) == 0) { return sec_addr; } } diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 89fd2bd215..212c77c039 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -139,8 +139,7 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) if (PIM_I_am_DualActive(pim_ifp)) { if (PIM_DEBUG_MLAG) zlog_debug( - "%s: if-chnanel-%s is deleted from a Dual " - "active Interface", + "%s: if-chnanel-%s is deleted from a Dual active Interface", __func__, ch->sg_str); /* Post Delete only if it is the last Dual-active Interface */ if (ch->upstream->dualactive_ifchannel_count == 1) { @@ -214,8 +213,7 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) else { if (PIM_DEBUG_PIM_TRACE) zlog_debug( - "%s: Avoiding deletion of upstream with ref_count %d " - "from ifchannel(%s): %s", + "%s: Avoiding deletion of upstream with ref_count %d from ifchannel(%s): %s", __func__, ch->upstream->ref_count, ch->interface->name, ch->sg_str); } @@ -622,8 +620,7 @@ struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp, } if (PIM_DEBUG_MLAG) zlog_debug( - "%s: New Dual active if-chnanel is added to upstream:%s " - "count:%d, flags:0x%x", + "%s: New Dual active if-chnanel is added to upstream:%s count:%d, flags:0x%x", __func__, up->sg_str, up->dualactive_ifchannel_count, up->flags); } diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 851b00b2ac..a8612f91fa 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -351,9 +351,7 @@ static int igmp_recv_query(struct igmp_sock *igmp, int query_version, */ if (query_version != pim_ifp->igmp_version) { zlog_warn( - "Recv IGMP query v%d from %s on %s but we are using v%d, please " - "configure all PIM routers on this subnet to use the same " - "IGMP version", + "Recv IGMP query v%d from %s on %s but we are using v%d, please configure all PIM routers on this subnet to use the same IGMP version", query_version, from_str, ifp->name, pim_ifp->igmp_version); return 0; diff --git a/pimd/pim_igmp_mtrace.c b/pimd/pim_igmp_mtrace.c index cac6fab271..9e78b76008 100644 --- a/pimd/pim_igmp_mtrace.c +++ b/pimd/pim_igmp_mtrace.c @@ -231,9 +231,7 @@ static void mtrace_debug(struct pim_interface *pim_ifp, ra = mtracep->rsp_addr; zlog_debug( - "Rx mtrace packet incoming on %s: " - "hops=%d type=%d size=%d, grp=%s, src=%s," - " dst=%s rsp=%s ttl=%d qid=%ud", + "Rx mtrace packet incoming on %s: hops=%d type=%d size=%d, grp=%s, src=%s, dst=%s rsp=%s ttl=%d qid=%ud", inet_ntop(AF_INET, &(pim_ifp->primary_address), inc_str, sizeof(inc_str)), mtracep->hops, mtracep->type, mtrace_len, @@ -255,8 +253,7 @@ static void mtrace_debug(struct pim_interface *pim_ifp, if ((responses % sizeof(struct igmp_mtrace_rsp)) != 0) if (PIM_DEBUG_MTRACE) zlog_debug( - "Mtrace response block of wrong" - " length"); + "Mtrace response block of wrong length"); responses = responses / sizeof(struct igmp_mtrace_rsp); @@ -358,17 +355,14 @@ static int mtrace_send_packet(struct interface *ifp, if (sent < 0) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Send mtrace request failed for %s on" - "%s: group=%s msg_size=%zd: errno=%d: " - " %s", + "Send mtrace request failed for %s on%s: group=%s msg_size=%zd: errno=%d: %s", dst_str, ifp->name, group_str, mtrace_buf_len, errno, safe_strerror(errno)); } else { if (PIM_DEBUG_MTRACE) zlog_warn( - "Send mtrace request failed for %s on" - " %s: group=%s msg_size=%zd: sent=%zd", + "Send mtrace request failed for %s on %s: group=%s msg_size=%zd: sent=%zd", dst_str, ifp->name, group_str, mtrace_buf_len, sent); } @@ -418,8 +412,7 @@ static int mtrace_un_forward_packet(struct pim_instance *pim, struct ip *ip_hdr, close(fd); if (PIM_DEBUG_MTRACE) zlog_warn( - "Dropping mtrace packet, " - "no route to destination"); + "Dropping mtrace packet, no route to destination"); return -1; } @@ -448,8 +441,7 @@ static int mtrace_un_forward_packet(struct pim_instance *pim, struct ip *ip_hdr, if (sent < 0) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Failed to forward mtrace packet:" - " sendto errno=%d, %s", + "Failed to forward mtrace packet: sendto errno=%d, %s", errno, safe_strerror(errno)); return -1; } @@ -480,8 +472,7 @@ static int mtrace_mc_forward_packet(struct pim_instance *pim, struct ip *ip_hdr) if (c_oil == NULL) { if (PIM_DEBUG_MTRACE) { zlog_debug( - "Dropping mtrace multicast packet " - "len=%u to %s ttl=%u", + "Dropping mtrace multicast packet len=%u to %s ttl=%u", ntohs(ip_hdr->ip_len), inet_ntoa(ip_hdr->ip_dst), ip_hdr->ip_ttl); } @@ -532,8 +523,7 @@ static int mtrace_send_mc_response(struct pim_instance *pim, if (c_oil == NULL) { if (PIM_DEBUG_MTRACE) { zlog_debug( - "Dropping mtrace multicast response packet " - "len=%u to %s", + "Dropping mtrace multicast response packet len=%u to %s", (unsigned int)mtrace_len, inet_ntoa(mtracep->rsp_addr)); } @@ -595,8 +585,7 @@ static int mtrace_send_response(struct pim_instance *pim, if (!pim_nexthop_lookup(pim, &nexthop, mtracep->rsp_addr, 1)) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Dropped response qid=%ud, no route to " - "response address", + "Dropped response qid=%ud, no route to response address", mtracep->qry_id); return -1; } @@ -645,8 +634,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, if (igmp_msg_len < (int)sizeof(struct igmp_mtrace)) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace packet from %s on %s: too short," - " len=%d, min=%zu", + "Recv mtrace packet from %s on %s: too short, len=%d, min=%zu", from_str, ifp->name, igmp_msg_len, sizeof(struct igmp_mtrace)); return -1; @@ -663,8 +651,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, if (recv_checksum != checksum) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace packet from %s on %s: checksum" - " mismatch: received=%x computed=%x", + "Recv mtrace packet from %s on %s: checksum mismatch: received=%x computed=%x", from_str, ifp->name, recv_checksum, checksum); return -1; } @@ -688,8 +675,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, if (IPV4_CLASS_DE(ntohl(ip_hdr->ip_dst.s_addr))) { if (PIM_DEBUG_MTRACE) zlog_debug( - "Dropping multicast query " - "on wrong interface"); + "Dropping multicast query on wrong interface"); return -1; } /* Unicast query on wrong interface */ @@ -700,8 +686,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, if (qry_id == mtracep->qry_id && qry_src == from.s_addr) { if (PIM_DEBUG_MTRACE) zlog_debug( - "Dropping multicast query with " - "duplicate source and id"); + "Dropping multicast query with duplicate source and id"); return -1; } qry_id = mtracep->qry_id; @@ -721,8 +706,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, } else { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace packet from %s on %s: " - "invalid length %d", + "Recv mtrace packet from %s on %s: invalid length %d", from_str, ifp->name, igmp_msg_len); return -1; } @@ -732,8 +716,7 @@ int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr, && !IPV4_MC_LINKLOCAL(ntohl(ip_hdr->ip_dst.s_addr))) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace packet from %s on %s:" - " not link-local multicast %s", + "Recv mtrace packet from %s on %s: not link-local multicast %s", from_str, ifp->name, inet_ntoa(ip_hdr->ip_dst)); return -1; } @@ -866,8 +849,7 @@ int igmp_mtrace_recv_response(struct igmp_sock *igmp, struct ip *ip_hdr, if (igmp_msg_len < (int)sizeof(struct igmp_mtrace)) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace packet from %s on %s: too short," - " len=%d, min=%zu", + "Recv mtrace packet from %s on %s: too short, len=%d, min=%zu", from_str, ifp->name, igmp_msg_len, sizeof(struct igmp_mtrace)); return -1; @@ -884,8 +866,7 @@ int igmp_mtrace_recv_response(struct igmp_sock *igmp, struct ip *ip_hdr, if (recv_checksum != checksum) { if (PIM_DEBUG_MTRACE) zlog_warn( - "Recv mtrace response from %s on %s: checksum" - " mismatch: received=%x computed=%x", + "Recv mtrace response from %s on %s: checksum mismatch: received=%x computed=%x", from_str, ifp->name, recv_checksum, checksum); return -1; } diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c index 305dd5cf2c..2dfc0af1de 100644 --- a/pimd/pim_mlag.c +++ b/pimd/pim_mlag.c @@ -1082,6 +1082,14 @@ void pim_instance_mlag_terminate(struct pim_instance *pim) pim->inst_mlag_intf_cnt = 0; } +void pim_mlag_terminate(void) +{ + stream_free(router->mlag_stream); + router->mlag_stream = NULL; + stream_fifo_free(router->mlag_fifo); + router->mlag_fifo = NULL; +} + void pim_mlag_init(void) { pim_mlag_param_reset(); diff --git a/pimd/pim_mlag.h b/pimd/pim_mlag.h index eb316695f7..b044c31c44 100644 --- a/pimd/pim_mlag.h +++ b/pimd/pim_mlag.h @@ -28,6 +28,7 @@ #include "pim_iface.h" extern void pim_mlag_init(void); +extern void pim_mlag_terminate(void); extern void pim_instance_mlag_init(struct pim_instance *pim); extern void pim_instance_mlag_terminate(struct pim_instance *pim); extern void pim_if_configure_mlag_dualactive(struct pim_interface *pim_ifp); diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 1611eac95d..93fe787a93 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -141,6 +141,9 @@ void pim_rp_free(struct pim_instance *pim) { if (pim->rp_list) list_delete(&pim->rp_list); + if (pim->rp_table) + route_table_finish(pim->rp_table); + pim->rp_table = NULL; } /* diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index 010ec7d745..043ccdb848 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -78,8 +78,7 @@ bool pim_nexthop_lookup(struct pim_instance *pim, struct pim_nexthop *nexthop, pim_addr_dump("<nexthop?>", &nexthop->mrib_nexthop_addr, nexthop_str, sizeof(nexthop_str)); zlog_debug( - "%s: Using last lookup for %s at %lld, %" PRId64 - " addr %s", + "%s: Using last lookup for %s at %lld, %" PRId64" addr %s", __func__, addr_str, nexthop->last_lookup_time, pim->last_route_change_time, nexthop_str); } @@ -347,6 +346,7 @@ void pim_upstream_rpf_clear(struct pim_instance *pim, struct pim_upstream *up) { if (up->rpf.source_nexthop.interface) { + pim_upstream_switch(pim, up, PIM_UPSTREAM_NOTJOINED); up->rpf.source_nexthop.interface = NULL; up->rpf.source_nexthop.mrib_nexthop_addr.u.prefix4.s_addr = PIM_NET_INADDR_ANY; diff --git a/pimd/pimd.c b/pimd/pimd.c index 5ccbac32f2..6c354a3cc8 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -42,6 +42,7 @@ #include "pim_vxlan.h" #include "pim_zlookup.h" #include "pim_zebra.h" +#include "pim_mlag.h" const char *const PIM_ALL_SYSTEMS = MCAST_ALL_SYSTEMS; const char *const PIM_ALL_ROUTERS = MCAST_ALL_ROUTERS; @@ -109,6 +110,7 @@ void pim_router_init(void) void pim_router_terminate(void) { + pim_mlag_terminate(); XFREE(MTYPE_ROUTER, router); } diff --git a/pimd/subdir.am b/pimd/subdir.am index 121abea598..8540651544 100644 --- a/pimd/subdir.am +++ b/pimd/subdir.am @@ -127,6 +127,12 @@ clippy_scan += \ pimd/pim_cmd.c \ # end +nodist_pimd_pimd_SOURCES = \ + yang/frr-igmp.yang.c \ + yang/frr-pim.yang.c \ + yang/frr-pim-rp.yang.c \ + # end + pimd_pimd_LDADD = pimd/libpim.a lib/libfrr.la $(LIBCAP) pimd_pimd_SOURCES = pimd/pim_main.c |
