summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_attr.c2
-rw-r--r--bgpd/bgp_evpn_vty.c4
-rw-r--r--bgpd/bgp_packet.c31
-rw-r--r--bgpd/bgp_route.c2
-rw-r--r--bgpd/bgpd.h1
-rw-r--r--include/linux/rtnetlink.h12
-rw-r--r--isisd/isis_nb_config.c2
-rw-r--r--isisd/isisd.c6
-rw-r--r--isisd/isisd.h1
-rw-r--r--pathd/path_ted.c2
-rw-r--r--pimd/pim6_mld.c91
-rw-r--r--pimd/pim_cmd_common.c96
-rw-r--r--pimd/pim_iface.c12
-rw-r--r--pimd/pim_igmp.h12
-rw-r--r--pimd/pim_nb_config.c7
-rw-r--r--pimd/pim_vty.c16
-rw-r--r--pimd/pimd.h18
-rw-r--r--tools/coccinelle/route_map_apply.cocci15
-rw-r--r--zebra/if_ioctl.c4
-rw-r--r--zebra/if_netlink.c4
-rw-r--r--zebra/if_sysctl.c4
21 files changed, 221 insertions, 121 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index d91c717f37..b7d0958bac 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -983,7 +983,7 @@ struct attr *bgp_attr_aggregate_intern(
{
struct attr attr;
struct attr *new;
- int ret;
+ route_map_result_t ret;
memset(&attr, 0, sizeof(attr));
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index f6b87dccdb..c16ac5636b 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -6031,6 +6031,7 @@ DEFUN(no_bgp_evpn_ead_es_rt, no_bgp_evpn_ead_es_rt_cmd,
if (!bgp_evpn_rt_matches_existing(bgp_mh_info->ead_es_export_rtl,
ecomdel)) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match EAD-ES RT configuration\n");
return CMD_WARNING;
@@ -6165,6 +6166,7 @@ DEFUN (no_bgp_evpn_vni_rt,
if (rt_type == RT_TYPE_IMPORT) {
if (!bgp_evpn_rt_matches_existing(vpn->import_rtl, ecomdel)) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VNI\n");
return CMD_WARNING;
@@ -6172,6 +6174,7 @@ DEFUN (no_bgp_evpn_vni_rt,
evpn_unconfigure_import_rt(bgp, vpn, ecomdel);
} else if (rt_type == RT_TYPE_EXPORT) {
if (!bgp_evpn_rt_matches_existing(vpn->export_rtl, ecomdel)) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VNI\n");
return CMD_WARNING;
@@ -6191,6 +6194,7 @@ DEFUN (no_bgp_evpn_vni_rt,
}
if (!found_ecomdel) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VNI\n");
return CMD_WARNING;
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 90695219a7..cc18808373 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -360,6 +360,31 @@ int bgp_nlri_parse(struct peer *peer, struct attr *attr,
return BGP_NLRI_PARSE_ERROR;
}
+
+/*
+ * Check if route-refresh request from peer is pending (received before EoR),
+ * and process it now.
+ */
+static void bgp_process_pending_refresh(struct peer *peer, afi_t afi,
+ safi_t safi)
+{
+ if (CHECK_FLAG(peer->af_sflags[afi][safi],
+ PEER_STATUS_REFRESH_PENDING)) {
+ UNSET_FLAG(peer->af_sflags[afi][safi],
+ PEER_STATUS_REFRESH_PENDING);
+ bgp_route_refresh_send(peer, afi, safi, 0, 0, 0,
+ BGP_ROUTE_REFRESH_BORR);
+ if (bgp_debug_neighbor_events(peer))
+ zlog_debug(
+ "%pBP sending route-refresh (BoRR) for %s/%s (for pending REQUEST)",
+ peer, afi2str(afi), safi2str(safi));
+
+ SET_FLAG(peer->af_sflags[afi][safi], PEER_STATUS_BORR_SEND);
+ UNSET_FLAG(peer->af_sflags[afi][safi], PEER_STATUS_EORR_SEND);
+ bgp_announce_route(peer, afi, safi, true);
+ }
+}
+
/*
* Checks a variety of conditions to determine whether the peer needs to be
* rescheduled for packet generation again, and does so if necessary.
@@ -558,6 +583,9 @@ void bgp_generate_updgrp_packets(struct thread *thread)
BGP_UPDATE_EOR_PKT(
peer, afi, safi,
s);
+ bgp_process_pending_refresh(
+ peer, afi,
+ safi);
}
}
}
@@ -2564,6 +2592,9 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size)
"%pBP rcvd route-refresh (REQUEST) for %s/%s before EoR",
peer, afi2str(afi),
safi2str(safi));
+ /* Can't send BoRR now, postpone after EoR */
+ SET_FLAG(peer->af_sflags[afi][safi],
+ PEER_STATUS_REFRESH_PENDING);
return BGP_PACKET_NOOP;
}
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 162a7ed881..eb00287890 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -6014,6 +6014,7 @@ void bgp_static_update(struct bgp *bgp, const struct prefix *p,
/* Unintern original. */
aspath_unintern(&attr.aspath);
bgp_static_withdraw(bgp, p, afi, safi);
+ bgp_dest_unlock_node(dest);
return;
}
@@ -6340,6 +6341,7 @@ static void bgp_static_update_safi(struct bgp *bgp, const struct prefix *p,
aspath_unintern(&attr.aspath);
bgp_static_withdraw_safi(bgp, p, afi, safi,
&bgp_static->prd);
+ bgp_dest_unlock_node(dest);
return;
}
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 28883c9e7c..f6162f33e4 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1456,6 +1456,7 @@ struct peer {
#define PEER_STATUS_EORR_RECEIVED (1U << 10) /* EoRR received from peer */
/* LLGR aware peer */
#define PEER_STATUS_LLGR_WAIT (1U << 11)
+#define PEER_STATUS_REFRESH_PENDING (1U << 12) /* refresh request from peer */
/* Configured timer values. */
_Atomic uint32_t holdtime;
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index b15b72a262..71ad7bf69e 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -188,12 +188,12 @@ enum {
RTM_SETHWFLAGS = 119,
#define RTM_SETHWFLAGS RTM_SETHWFLAGS
- RTM_NEWTUNNEL = 120,
-#define RTM_NEWTUNNEL RTM_NEWTUNNEL
- RTM_DELTUNNEL,
-#define RTM_DELTUNNEL RTM_DELTUNNEL
- RTM_GETTUNNEL,
-#define RTM_GETTUNNEL RTM_GETTUNNEL
+ RTM_NEWTUNNEL = 120,
+#define RTM_NEWTUNNEL RTM_NEWTUNNEL
+ RTM_DELTUNNEL,
+#define RTM_DELTUNNEL RTM_DELTUNNEL
+ RTM_GETTUNNEL,
+#define RTM_GETTUNNEL RTM_GETTUNNEL
__RTM_MAX,
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c
index dbe4a017bc..e0decf48f2 100644
--- a/isisd/isis_nb_config.c
+++ b/isisd/isis_nb_config.c
@@ -54,8 +54,6 @@
#include "isisd/isis_dr.h"
#include "isisd/isis_zebra.h"
-DEFINE_MTYPE_STATIC(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");
-
/*
* XPath: /frr-isisd:isis/instance
*/
diff --git a/isisd/isisd.c b/isisd/isisd.c
index bce3dbb77b..54e6be5970 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -90,6 +90,7 @@ DEFINE_MTYPE_STATIC(ISISD, ISIS_NAME, "ISIS process name");
DEFINE_MTYPE_STATIC(ISISD, ISIS_AREA, "ISIS area");
DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address");
DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name");
+DEFINE_MTYPE(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");
DEFINE_QOBJ_TYPE(isis_area);
@@ -565,6 +566,11 @@ void isis_area_destroy(struct isis_area *area)
area_mt_finish(area);
+ if (area->rlfa_plist_name[0])
+ XFREE(MTYPE_ISIS_PLIST_NAME, area->rlfa_plist_name[0]);
+ if (area->rlfa_plist_name[1])
+ XFREE(MTYPE_ISIS_PLIST_NAME, area->rlfa_plist_name[1]);
+
XFREE(MTYPE_ISIS_AREA, area);
}
diff --git a/isisd/isisd.h b/isisd/isisd.h
index c313fd9ef7..4951e5809b 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -251,6 +251,7 @@ DECLARE_QOBJ_TYPE(isis_area);
DECLARE_MTYPE(ISIS_ACL_NAME); /* isis_area->spf_prefix_prioritites */
DECLARE_MTYPE(ISIS_AREA_ADDR); /* isis_area->area_addrs */
+DECLARE_MTYPE(ISIS_PLIST_NAME);
DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area));
diff --git a/pathd/path_ted.c b/pathd/path_ted.c
index 270c664daf..7afa1468a1 100644
--- a/pathd/path_ted.c
+++ b/pathd/path_ted.c
@@ -385,7 +385,7 @@ DEFUN (no_path_ted,
"Disable the TE Database functionality\n")
/* clang-format on */
{
- if (ted_state_g.enabled) {
+ if (!ted_state_g.enabled) {
PATH_TED_DEBUG("%s: PATHD-TED: OFF -> OFF", __func__);
return CMD_SUCCESS;
}
diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c
index b9c3aec30c..ee5c715eae 100644
--- a/pimd/pim6_mld.c
+++ b/pimd/pim6_mld.c
@@ -1609,7 +1609,7 @@ static void gm_t_recv(struct thread *t)
char rxbuf[2048];
struct msghdr mh[1] = {};
struct iovec iov[1];
- struct sockaddr_in6 pkt_src[1];
+ struct sockaddr_in6 pkt_src[1] = {};
ssize_t nread;
size_t pktlen;
@@ -2122,15 +2122,47 @@ static void gm_start(struct interface *ifp)
}
}
-void gm_ifp_teardown(struct interface *ifp)
+void gm_group_delete(struct gm_if *gm_ifp)
{
- struct pim_interface *pim_ifp = ifp->info;
- struct gm_if *gm_ifp;
+ struct gm_sg *sg;
struct gm_packet_state *pkt;
struct gm_grp_pending *pend_grp;
struct gm_gsq_pending *pend_gsq;
struct gm_subscriber *subscriber;
- struct gm_sg *sg;
+
+ while ((pkt = gm_packet_expires_first(gm_ifp->expires)))
+ gm_packet_drop(pkt, false);
+
+ while ((pend_grp = gm_grp_pends_pop(gm_ifp->grp_pends))) {
+ THREAD_OFF(pend_grp->t_expire);
+ XFREE(MTYPE_GM_GRP_PENDING, pend_grp);
+ }
+
+ while ((pend_gsq = gm_gsq_pends_pop(gm_ifp->gsq_pends))) {
+ THREAD_OFF(pend_gsq->t_send);
+ XFREE(MTYPE_GM_GSQ_PENDING, pend_gsq);
+ }
+
+ while ((sg = gm_sgs_pop(gm_ifp->sgs))) {
+ THREAD_OFF(sg->t_sg_expire);
+ assertf(!gm_packet_sg_subs_count(sg->subs_negative), "%pSG",
+ &sg->sgaddr);
+ assertf(!gm_packet_sg_subs_count(sg->subs_positive), "%pSG",
+ &sg->sgaddr);
+
+ gm_sg_free(sg);
+ }
+ while ((subscriber = gm_subscribers_pop(gm_ifp->subscribers))) {
+ assertf(!gm_packets_count(subscriber->packets), "%pPA",
+ &subscriber->addr);
+ XFREE(MTYPE_GM_SUBSCRIBER, subscriber);
+ }
+}
+
+void gm_ifp_teardown(struct interface *ifp)
+{
+ struct pim_interface *pim_ifp = ifp->info;
+ struct gm_if *gm_ifp;
if (!pim_ifp || !pim_ifp->mld)
return;
@@ -2161,34 +2193,7 @@ void gm_ifp_teardown(struct interface *ifp)
gm_vrf_socket_decref(gm_ifp->pim);
- while ((pkt = gm_packet_expires_first(gm_ifp->expires)))
- gm_packet_drop(pkt, false);
-
- while ((pend_grp = gm_grp_pends_pop(gm_ifp->grp_pends))) {
- THREAD_OFF(pend_grp->t_expire);
- XFREE(MTYPE_GM_GRP_PENDING, pend_grp);
- }
-
- while ((pend_gsq = gm_gsq_pends_pop(gm_ifp->gsq_pends))) {
- THREAD_OFF(pend_gsq->t_send);
- XFREE(MTYPE_GM_GSQ_PENDING, pend_gsq);
- }
-
- while ((sg = gm_sgs_pop(gm_ifp->sgs))) {
- THREAD_OFF(sg->t_sg_expire);
- assertf(!gm_packet_sg_subs_count(sg->subs_negative), "%pSG",
- &sg->sgaddr);
- assertf(!gm_packet_sg_subs_count(sg->subs_positive), "%pSG",
- &sg->sgaddr);
-
- gm_sg_free(sg);
- }
-
- while ((subscriber = gm_subscribers_pop(gm_ifp->subscribers))) {
- assertf(!gm_packets_count(subscriber->packets), "%pPA",
- &subscriber->addr);
- XFREE(MTYPE_GM_SUBSCRIBER, subscriber);
- }
+ gm_group_delete(gm_ifp);
gm_grp_pends_fini(gm_ifp->grp_pends);
gm_packet_expires_fini(gm_ifp->expires);
@@ -2308,22 +2313,6 @@ void gm_ifp_update(struct interface *ifp)
}
}
-void gm_group_delete(struct gm_if *gm_ifp)
-{
- struct gm_sg *sg, *sg_start;
-
- sg_start = gm_sgs_first(gm_ifp->sgs);
-
- /* clean up all mld groups */
- frr_each_from (gm_sgs, gm_ifp->sgs, sg, sg_start) {
- THREAD_OFF(sg->t_sg_expire);
- if (sg->oil)
- pim_channel_oil_del(sg->oil, __func__);
- gm_sgs_del(gm_ifp->sgs, sg);
- gm_sg_free(sg);
- }
-}
-
/*
* CLI (show commands only)
*/
@@ -2504,13 +2493,13 @@ static void gm_show_if(struct vty *vty, struct vrf *vrf, const char *ifname,
DEFPY(gm_show_interface,
gm_show_interface_cmd,
- "show ipv6 mld [vrf <VRF|all>$vrf_str] interface [IFNAME] [detail$detail|json$json]",
- DEBUG_STR
+ "show ipv6 mld [vrf <VRF|all>$vrf_str] interface [IFNAME | detail$detail] [json$json]",
SHOW_STR
IPV6_STR
MLD_STR
VRF_FULL_CMD_HELP_STR
"MLD interface information\n"
+ "Interface name\n"
"Detailed output\n"
JSON_STR)
{
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index 76409e9944..9283016d08 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -1672,9 +1672,9 @@ void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty, bool uj)
}
}
-static void pim_show_join_helper(struct vty *vty, struct pim_interface *pim_ifp,
+static void pim_show_join_helper(struct pim_interface *pim_ifp,
struct pim_ifchannel *ch, json_object *json,
- time_t now)
+ time_t now, struct ttable *tt)
{
json_object *json_iface = NULL;
json_object *json_row = NULL;
@@ -1741,8 +1741,8 @@ static void pim_show_join_helper(struct vty *vty, struct pim_interface *pim_ifp,
json_object_object_addf(json_grp, json_row, "%pPAs",
&ch->sg.src);
} else {
- vty_out(vty,
- "%-16s %-15pPAs %-15pPAs %-15pPAs %-10s %8s %-6s %5s\n",
+ ttable_add_row(
+ tt, "%s|%pPAs|%pPAs|%pPAs|%s|%s|%s|%s",
ch->interface->name, &ifaddr, &ch->sg.src, &ch->sg.grp,
pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags),
uptime, expire, prune);
@@ -1823,12 +1823,21 @@ void pim_show_join(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
struct pim_ifchannel *ch;
struct interface *ifp;
time_t now;
+ struct ttable *tt = NULL;
+ char *table = NULL;
now = pim_time_monotonic_sec();
- if (!json)
- vty_out(vty,
- "Interface Address Source Group State Uptime Expire Prune\n");
+ if (!json) {
+ /* Prepare table. */
+ tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]);
+ ttable_add_row(
+ tt,
+ "Interface|Address|Source|Group|State|Uptime|Expire|Prune");
+ tt->style.cell.rpad = 2;
+ tt->style.corner = '+';
+ ttable_restyle(tt);
+ }
FOR_ALL_INTERFACES (pim->vrf, ifp) {
pim_ifp = ifp->info;
@@ -1839,9 +1848,16 @@ void pim_show_join(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
if (!pim_sgaddr_match(ch->sg, *sg))
continue;
- pim_show_join_helper(vty, pim_ifp, ch, json, now);
+ pim_show_join_helper(pim_ifp, ch, json, now, tt);
} /* scan interface channels */
}
+ /* Dump the generated table. */
+ if (!json) {
+ table = ttable_dump(tt, "\n");
+ vty_out(vty, "%s\n", table);
+ XFREE(MTYPE_TMP, table);
+ ttable_del(tt);
+ }
}
static void pim_show_jp_agg_helper(struct interface *ifp,
@@ -1970,6 +1986,8 @@ void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj)
enum json_type type;
json_object *json = NULL;
json_object *json_tmp = NULL;
+ struct ttable *tt = NULL;
+ char *table = NULL;
json = json_object_new_object();
@@ -1986,8 +2004,12 @@ void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj)
if (uj) {
vty_json(vty, json);
} else {
- vty_out(vty,
- "Interface Address Source Group Membership\n");
+ /* Prepare table. */
+ tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]);
+ ttable_add_row(tt, "Interface|Address|Source|Group|Membership");
+ tt->style.cell.rpad = 2;
+ tt->style.corner = '+';
+ ttable_restyle(tt);
/*
* Example of the json data we are traversing
@@ -2024,34 +2046,40 @@ void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj)
type = json_object_get_type(if_field_val);
if (type == json_type_object) {
- vty_out(vty, "%-16s ", key);
+ const char *address, *source,
+ *localMembership;
json_object_object_get_ex(
val, "address", &json_tmp);
- vty_out(vty, "%-15s ",
- json_object_get_string(
- json_tmp));
+ address = json_object_get_string(
+ json_tmp);
json_object_object_get_ex(if_field_val,
"source",
&json_tmp);
- vty_out(vty, "%-15s ",
- json_object_get_string(
- json_tmp));
-
- /* Group */
- vty_out(vty, "%-15s ", if_field_key);
+ source = json_object_get_string(
+ json_tmp);
json_object_object_get_ex(
if_field_val, "localMembership",
&json_tmp);
- vty_out(vty, "%-10s\n",
+ localMembership =
json_object_get_string(
- json_tmp));
+ json_tmp);
+
+ ttable_add_row(tt, "%s|%s|%s|%s|%s",
+ key, address, source,
+ if_field_key,
+ localMembership);
}
}
}
json_object_free(json);
+ /* Dump the generated table. */
+ table = ttable_dump(tt, "\n");
+ vty_out(vty, "%s\n", table);
+ XFREE(MTYPE_TMP, table);
+ ttable_del(tt);
}
}
@@ -3196,6 +3224,8 @@ void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
struct interface *ifp;
struct pim_interface *pim_ifp;
struct pim_neighbor *neigh;
+ struct ttable *tt = NULL;
+ char *table = NULL;
time_t now;
char uptime[10];
char expire[10];
@@ -3206,8 +3236,12 @@ void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
now = pim_time_monotonic_sec();
if (!json) {
- vty_out(vty,
- "Interface Neighbor Uptime Holdtime DR Pri\n");
+ /* Prepare table. */
+ tt = ttable_new(&ttable_styles[TTSTYLE_BLANK]);
+ ttable_add_row(tt, "Interface|Neighbor|Uptime|Holdtime|DR Pri");
+ tt->style.cell.rpad = 2;
+ tt->style.corner = '+';
+ ttable_restyle(tt);
}
FOR_ALL_INTERFACES (pim->vrf, ifp) {
@@ -3249,9 +3283,10 @@ void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
neigh_src_str, json_row);
} else {
- vty_out(vty, "%-16s %15s %8s %8s %6d\n",
- ifp->name, neigh_src_str, uptime,
- expire, neigh->dr_priority);
+ ttable_add_row(tt, "%s|%pPAs|%s|%s|%d",
+ ifp->name, &neigh->source_addr,
+ uptime, expire,
+ neigh->dr_priority);
}
}
@@ -3260,6 +3295,13 @@ void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
json_ifp_rows = NULL;
}
}
+ /* Dump the generated table. */
+ if (!json) {
+ table = ttable_dump(tt, "\n");
+ vty_out(vty, "%s\n", table);
+ XFREE(MTYPE_TMP, table);
+ ttable_del(tt);
+ }
}
int gm_process_query_max_response_time_cmd(struct vty *vty,
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 105d9fabcd..6f272f0085 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -131,13 +131,13 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool gm, bool pim,
pim_ifp->igmp_version = IGMP_DEFAULT_VERSION;
pim_ifp->mld_version = MLD_DEFAULT_VERSION;
pim_ifp->gm_default_robustness_variable =
- IGMP_DEFAULT_ROBUSTNESS_VARIABLE;
- pim_ifp->gm_default_query_interval = IGMP_GENERAL_QUERY_INTERVAL;
+ GM_DEFAULT_ROBUSTNESS_VARIABLE;
+ pim_ifp->gm_default_query_interval = GM_GENERAL_QUERY_INTERVAL;
pim_ifp->gm_query_max_response_time_dsec =
- IGMP_QUERY_MAX_RESPONSE_TIME_DSEC;
+ GM_QUERY_MAX_RESPONSE_TIME_DSEC;
pim_ifp->gm_specific_query_max_response_time_dsec =
- IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC;
- pim_ifp->gm_last_member_query_count = IGMP_DEFAULT_ROBUSTNESS_VARIABLE;
+ GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC;
+ pim_ifp->gm_last_member_query_count = GM_DEFAULT_ROBUSTNESS_VARIABLE;
/* BSM config on interface: true by default */
pim_ifp->bsm_enable = true;
@@ -883,7 +883,7 @@ pim_addr pim_find_primary_addr(struct interface *ifp)
return pim_ifp->update_source;
#if PIM_IPV == 6
- if (pim_ifp)
+ if (pim_ifp && !pim_addr_is_any(pim_ifp->ll_highest))
return pim_ifp->ll_highest;
pim_addr best_addr = PIMADDR_ANY;
diff --git a/pimd/pim_igmp.h b/pimd/pim_igmp.h
index a642469f27..9ce3a2a17f 100644
--- a/pimd/pim_igmp.h
+++ b/pimd/pim_igmp.h
@@ -56,18 +56,6 @@
#define IGMP_V3_GROUP_RECORD_SOURCE_OFFSET (8)
#define IGMP_CHECKSUM_OFFSET (2)
-/* RFC 3376: 8.1. Robustness Variable - Default: 2 */
-#define IGMP_DEFAULT_ROBUSTNESS_VARIABLE (2)
-
-/* RFC 3376: 8.2. Query Interval - Default: 125 seconds */
-#define IGMP_GENERAL_QUERY_INTERVAL (125)
-
-/* RFC 3376: 8.3. Query Response Interval - Default: 100 deciseconds */
-#define IGMP_QUERY_MAX_RESPONSE_TIME_DSEC (100)
-
-/* RFC 3376: 8.8. Last Member Query Interval - Default: 10 deciseconds */
-#define IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC (10)
-
#define IGMP_DEFAULT_VERSION (3)
#define IGMP_GET_INT16(ptr, output) \
diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c
index 5c81f9b814..12f8ffedfe 100644
--- a/pimd/pim_nb_config.c
+++ b/pimd/pim_nb_config.c
@@ -2844,6 +2844,9 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify(
yang_dnode_get_uint16(args->dnode, NULL);
pim_ifp->gm_specific_query_max_response_time_dsec =
last_member_query_interval;
+#if PIM_IPV == 6
+ gm_ifp_update(ifp);
+#endif
break;
}
@@ -2872,7 +2875,9 @@ int lib_interface_gmp_address_family_robustness_variable_modify(
last_member_query_count =
yang_dnode_get_uint8(args->dnode, NULL);
pim_ifp->gm_last_member_query_count = last_member_query_count;
-
+#if PIM_IPV == 6
+ gm_ifp_update(ifp);
+#endif
break;
}
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index d01cb0c873..315fbae95c 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -314,14 +314,14 @@ static int gm_config_write(struct vty *vty, int writes,
/* IF ip igmp query-max-response-time */
if (pim_ifp->gm_query_max_response_time_dsec !=
- IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) {
+ GM_QUERY_MAX_RESPONSE_TIME_DSEC) {
vty_out(vty, " ip igmp query-max-response-time %d\n",
pim_ifp->gm_query_max_response_time_dsec);
++writes;
}
/* IF ip igmp query-interval */
- if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) {
+ if (pim_ifp->gm_default_query_interval != GM_GENERAL_QUERY_INTERVAL) {
vty_out(vty, " ip igmp query-interval %d\n",
pim_ifp->gm_default_query_interval);
++writes;
@@ -329,7 +329,7 @@ static int gm_config_write(struct vty *vty, int writes,
/* IF ip igmp last-member_query-count */
if (pim_ifp->gm_last_member_query_count !=
- IGMP_DEFAULT_ROBUSTNESS_VARIABLE) {
+ GM_DEFAULT_ROBUSTNESS_VARIABLE) {
vty_out(vty, " ip igmp last-member-query-count %d\n",
pim_ifp->gm_last_member_query_count);
++writes;
@@ -337,7 +337,7 @@ static int gm_config_write(struct vty *vty, int writes,
/* IF ip igmp last-member_query-interval */
if (pim_ifp->gm_specific_query_max_response_time_dsec !=
- IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
+ GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
vty_out(vty, " ip igmp last-member-query-interval %d\n",
pim_ifp->gm_specific_query_max_response_time_dsec);
++writes;
@@ -381,23 +381,23 @@ static int gm_config_write(struct vty *vty, int writes,
/* IF ipv6 mld query-max-response-time */
if (pim_ifp->gm_query_max_response_time_dsec !=
- IGMP_QUERY_MAX_RESPONSE_TIME_DSEC)
+ GM_QUERY_MAX_RESPONSE_TIME_DSEC)
vty_out(vty, " ipv6 mld query-max-response-time %d\n",
pim_ifp->gm_query_max_response_time_dsec);
- if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL)
+ if (pim_ifp->gm_default_query_interval != GM_GENERAL_QUERY_INTERVAL)
vty_out(vty, " ipv6 mld query-interval %d\n",
pim_ifp->gm_default_query_interval);
/* IF ipv6 mld last-member_query-count */
if (pim_ifp->gm_last_member_query_count !=
- IGMP_DEFAULT_ROBUSTNESS_VARIABLE)
+ GM_DEFAULT_ROBUSTNESS_VARIABLE)
vty_out(vty, " ipv6 mld last-member-query-count %d\n",
pim_ifp->gm_last_member_query_count);
/* IF ipv6 mld last-member_query-interval */
if (pim_ifp->gm_specific_query_max_response_time_dsec !=
- IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC)
+ GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC)
vty_out(vty, " ipv6 mld last-member-query-interval %d\n",
pim_ifp->gm_specific_query_max_response_time_dsec);
diff --git a/pimd/pimd.h b/pimd/pimd.h
index 06fcec2b6e..c77e98d635 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -261,6 +261,24 @@ extern uint8_t qpim_ecmp_rebalance_enable;
#define PIM_DONT_DEBUG_VXLAN (router->debugs &= ~PIM_MASK_VXLAN)
#define PIM_DONT_DEBUG_BSM (router->debugs &= ~PIM_MASK_BSM_PROC)
+/* RFC 3376: 8.1. Robustness Variable - Default: 2 for IGMP */
+/* RFC 2710: 7.1. Robustness Variable - Default: 2 for MLD */
+#define GM_DEFAULT_ROBUSTNESS_VARIABLE 2
+
+/* RFC 3376: 8.2. Query Interval - Default: 125 seconds for IGMP */
+/* RFC 2710: 7.2. Query Interval - Default: 125 seconds for MLD */
+#define GM_GENERAL_QUERY_INTERVAL 125
+
+/* RFC 3376: 8.3. Query Response Interval - Default: 100 deciseconds for IGMP */
+/* RFC 2710: 7.3. Query Response Interval - Default: 100 deciseconds for MLD */
+#define GM_QUERY_MAX_RESPONSE_TIME_DSEC 100
+
+/* RFC 3376: 8.8. Last Member Query Interval - Default: 10 deciseconds for IGMP
+ */
+/* RFC 2710: 7.8. Last Listener Query Interval - Default: 10 deciseconds for MLD
+ */
+#define GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC 10
+
void pim_router_init(void);
void pim_router_terminate(void);
diff --git a/tools/coccinelle/route_map_apply.cocci b/tools/coccinelle/route_map_apply.cocci
new file mode 100644
index 0000000000..ccca619d7e
--- /dev/null
+++ b/tools/coccinelle/route_map_apply.cocci
@@ -0,0 +1,15 @@
+@rmap@
+identifier ret;
+position p;
+@@
+
+int ret@p;
+...
+* ret = route_map_apply(...);
+
+@script:python@
+p << rmap.p;
+@@
+
+msg = "ERROR: Invalid type of return value variable for route_map_apply_ext()"
+coccilib.report.print_report(p[0], msg)
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c
index 2c83a7ed4c..e02f3d5624 100644
--- a/zebra/if_ioctl.c
+++ b/zebra/if_ioctl.c
@@ -199,7 +199,7 @@ static int if_getaddrs(void)
ifp = if_lookup_by_name(ifap->ifa_name, VRF_DEFAULT);
if (ifp == NULL) {
flog_err(EC_LIB_INTERFACE,
- "if_getaddrs(): Can't lookup interface %s",
+ "%s: Can't lookup interface %s", __func__,
ifap->ifa_name);
continue;
}
@@ -290,7 +290,7 @@ static void interface_info_ioctl()
void interface_list(struct zebra_ns *zns)
{
- zlog_info("interface_list: NS %u", zns->ns_id);
+ zlog_info("%s: NS %u", __func__, zns->ns_id);
/* Linux can do both proc & ioctl, ioctl is the only way to get
interface aliases in 2.2 series kernels. */
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index c7e7443a1b..0927bdc1d9 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -1443,7 +1443,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
if (IS_ZEBRA_DEBUG_KERNEL) /* remove this line to see initial ifcfg */
{
char buf[BUFSIZ];
- zlog_debug("netlink_interface_addr %s %s flags 0x%x:",
+ zlog_debug("%s %s %s flags 0x%x:", __func__,
nl_msg_type_to_str(h->nlmsg_type), ifp->name,
kernel_flags);
if (tb[IFA_LOCAL])
@@ -1818,7 +1818,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
/* assume if not default zns, then new VRF */
if (!(h->nlmsg_type == RTM_NEWLINK || h->nlmsg_type == RTM_DELLINK)) {
/* If this is not link add/delete message so print warning. */
- zlog_debug("netlink_link_change: wrong kernel message %s",
+ zlog_debug("%s: wrong kernel message %s", __func__,
nl_msg_type_to_str(h->nlmsg_type));
return 0;
}
diff --git a/zebra/if_sysctl.c b/zebra/if_sysctl.c
index 38729c8d38..70d11646c3 100644
--- a/zebra/if_sysctl.c
+++ b/zebra/if_sysctl.c
@@ -97,7 +97,7 @@ void interface_list(struct zebra_ns *zns)
NET_RT_IFLIST, 0};
if (zns->ns_id != NS_DEFAULT) {
- zlog_debug("interface_list: ignore NS %u", zns->ns_id);
+ zlog_debug("%s: ignore NS %u", __func__, zns->ns_id);
return;
}
@@ -132,7 +132,7 @@ void interface_list(struct zebra_ns *zns)
ifam_read((struct ifa_msghdr *)ifm);
break;
default:
- zlog_info("interfaces_list(): unexpected message type");
+ zlog_info("%s: unexpected message type", __func__);
XFREE(MTYPE_TMP, ref);
return;
break;