summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_addpath.c2
-rw-r--r--bgpd/bgp_evpn.c17
-rw-r--r--bgpd/bgp_evpn.h41
-rw-r--r--bgpd/bgp_mplsvpn.c39
-rw-r--r--bgpd/bgp_mplsvpn.h33
-rw-r--r--bgpd/bgp_route.c10
-rw-r--r--bgpd/bgp_route.h18
-rw-r--r--eigrpd/eigrp_fsm.c8
-rw-r--r--isisd/isis_pdu.c6
-rw-r--r--lib/vrf.c2
-rw-r--r--lib/zclient.c8
-rw-r--r--ospf6d/ospf6_area.c6
-rw-r--r--ospf6d/ospf6_asbr.c2
-rw-r--r--ospf6d/ospf6_spf.c2
-rw-r--r--ospfd/ospf_api.c6
-rw-r--r--ospfd/ospf_apiserver.c4
-rw-r--r--ospfd/ospf_ri.c6
-rw-r--r--ospfd/ospf_snmp.c2
-rw-r--r--ospfd/ospf_spf.c4
-rw-r--r--ospfd/ospf_sr.c2
-rw-r--r--pimd/pim_cmd.c2
-rw-r--r--pimd/pim_register.c2
-rw-r--r--ripngd/ripng_interface.c4
-rw-r--r--zebra/irdp_main.c2
-rw-r--r--zebra/irdp_packet.c4
-rw-r--r--zebra/kernel_netlink.c2
-rw-r--r--zebra/kernel_socket.c2
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zapi_msg.c8
-rw-r--r--zebra/zebra_ptm.c4
-rw-r--r--zebra/zebra_rnh.c6
31 files changed, 180 insertions, 76 deletions
diff --git a/bgpd/bgp_addpath.c b/bgpd/bgp_addpath.c
index c7fd1ba0e2..63373cb9a7 100644
--- a/bgpd/bgp_addpath.c
+++ b/bgpd/bgp_addpath.c
@@ -384,7 +384,7 @@ void bgp_addpath_set_peer_type(struct peer *peer, afi_t afi, safi_t safi,
}
}
- zlog_info("Resetting peer %s%s due to change in addpath config\n",
+ zlog_info("Resetting peer %s%s due to change in addpath config",
CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP) ? "group " : "",
peer->host);
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 84f3649758..19cda453f5 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -2502,6 +2502,9 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
/* Perform route selection and update zebra, if required. */
bgp_process(bgp_vrf, rn, afi, safi);
+ /* Process for route leaking. */
+ vpn_leak_from_vrf_update(bgp_get_default(), bgp_vrf, pi);
+
return ret;
}
@@ -2667,6 +2670,9 @@ static int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
if (!pi)
return 0;
+ /* Process for route leaking. */
+ vpn_leak_from_vrf_withdraw(bgp_get_default(), bgp_vrf, pi);
+
bgp_aggregate_decrement(bgp_vrf, &rn->p, pi, afi, safi);
/* Mark entry for deletion */
@@ -4222,11 +4228,13 @@ void bgp_evpn_withdraw_type5_routes(struct bgp *bgp_vrf, afi_t afi, safi_t safi)
table = bgp_vrf->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
- /* Only care about "selected" routes - non-imported. */
+ /* Only care about "selected" routes. Also ensure that
+ * these are routes that are injectable into EVPN.
+ */
/* TODO: Support for AddPath for EVPN. */
for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
- && (!pi->extra || !pi->extra->parent)) {
+ && is_route_injectable_into_evpn(pi)) {
bgp_evpn_withdraw_type5_route(bgp_vrf, &rn->p,
afi, safi);
break;
@@ -4293,12 +4301,13 @@ void bgp_evpn_advertise_type5_routes(struct bgp *bgp_vrf, afi_t afi,
table = bgp_vrf->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
/* Need to identify the "selected" route entry to use its
- * attribute. Also, we only consider "non-imported" routes.
+ * attribute. Also, ensure that the route is injectable
+ * into EVPN.
* TODO: Support for AddPath for EVPN.
*/
for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {
if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
- && (!pi->extra || !pi->extra->parent)) {
+ && is_route_injectable_into_evpn(pi)) {
/* apply the route-map */
if (bgp_vrf->adv_cmd_rmap[afi][safi].map) {
diff --git a/bgpd/bgp_evpn.h b/bgpd/bgp_evpn.h
index fbf30083e1..22fb0939c9 100644
--- a/bgpd/bgp_evpn.h
+++ b/bgpd/bgp_evpn.h
@@ -88,8 +88,13 @@ static inline int is_route_parent_evpn(struct bgp_path_info *ri)
!ri->extra->parent)
return 0;
- /* See if the parent is of family L2VPN/EVPN */
- parent_ri = (struct bgp_path_info *)ri->extra->parent;
+ /* Determine parent recursively */
+ for (parent_ri = ri->extra->parent;
+ parent_ri->extra && parent_ri->extra->parent;
+ parent_ri = parent_ri->extra->parent)
+ ;
+
+ /* See if of family L2VPN/EVPN */
rn = parent_ri->net;
if (!rn)
return 0;
@@ -101,6 +106,38 @@ static inline int is_route_parent_evpn(struct bgp_path_info *ri)
return 0;
}
+/* Flag if the route path's family is EVPN. */
+static inline bool is_pi_family_evpn(struct bgp_path_info *pi)
+{
+ return is_pi_family_matching(pi, AFI_L2VPN, SAFI_EVPN);
+}
+
+/* Flag if the route is injectable into EVPN. This would be either a
+ * non-imported route or a non-EVPN imported route.
+ */
+static inline bool is_route_injectable_into_evpn(struct bgp_path_info *pi)
+{
+ struct bgp_path_info *parent_pi;
+ struct bgp_table *table;
+ struct bgp_node *rn;
+
+ if (pi->sub_type != BGP_ROUTE_IMPORTED ||
+ !pi->extra ||
+ !pi->extra->parent)
+ return true;
+
+ parent_pi = (struct bgp_path_info *)pi->extra->parent;
+ rn = parent_pi->net;
+ if (!rn)
+ return true;
+ table = bgp_node_table(rn);
+ if (table &&
+ table->afi == AFI_L2VPN &&
+ table->safi == SAFI_EVPN)
+ return false;
+ return true;
+}
+
extern void bgp_evpn_advertise_type5_route(struct bgp *bgp_vrf,
struct prefix *p,
struct attr *src_attr, afi_t afi,
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 765170d1a5..d211f1afff 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -46,6 +46,7 @@
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_nexthop.h"
#include "bgpd/bgp_nht.h"
+#include "bgpd/bgp_evpn.h"
#if ENABLE_BGP_VNC
#include "bgpd/rfapi/rfapi_backend.h"
@@ -552,8 +553,12 @@ leak_update(struct bgp *bgp, /* destination bgp instance */
if (bpi->extra && bpi->extra->bgp_orig)
bgp_nexthop = bpi->extra->bgp_orig;
- /* No nexthop tracking for redistributed routes */
- if (bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE)
+ /*
+ * No nexthop tracking for redistributed routes or for
+ * EVPN-imported routes that get leaked.
+ */
+ if (bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE ||
+ is_pi_family_evpn(bpi_ultimate))
nh_valid = 1;
else
/*
@@ -614,8 +619,11 @@ leak_update(struct bgp *bgp, /* destination bgp instance */
* No nexthop tracking for redistributed routes because
* their originating protocols will do the tracking and
* withdraw those routes if the nexthops become unreachable
+ * This also holds good for EVPN-imported routes that get
+ * leaked.
*/
- if (bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE)
+ if (bpi_ultimate->sub_type == BGP_ROUTE_REDISTRIBUTE ||
+ is_pi_family_evpn(bpi_ultimate))
nh_valid = 1;
else
/*
@@ -683,11 +691,10 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
return;
}
- /* loop check - should not be an imported route. */
- if (path_vrf->extra && path_vrf->extra->bgp_orig)
+ /* Is this route exportable into the VPN table? */
+ if (!is_route_injectable_into_vpn(path_vrf))
return;
-
if (!vpn_leak_to_vpn_active(bgp_vrf, afi, &debugmsg)) {
if (debug)
zlog_debug("%s: %s skipping: %s", __func__,
@@ -894,15 +901,6 @@ void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn, /* to */
path_vrf->type, path_vrf->sub_type);
}
- if (path_vrf->sub_type != BGP_ROUTE_NORMAL
- && path_vrf->sub_type != BGP_ROUTE_STATIC
- && path_vrf->sub_type != BGP_ROUTE_REDISTRIBUTE) {
-
- if (debug)
- zlog_debug("%s: wrong sub_type %d", __func__,
- path_vrf->sub_type);
- return;
- }
if (!bgp_vpn)
return;
@@ -912,6 +910,10 @@ void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn, /* to */
return;
}
+ /* Is this route exportable into the VPN table? */
+ if (!is_route_injectable_into_vpn(path_vrf))
+ return;
+
if (!vpn_leak_to_vpn_active(bgp_vrf, afi, &debugmsg)) {
if (debug)
zlog_debug("%s: skipping: %s", __func__, debugmsg);
@@ -995,7 +997,7 @@ void vpn_leak_from_vrf_withdraw_all(struct bgp *bgp_vpn, /* to */
== bgp_vrf) {
/* delete route */
if (debug)
- zlog_debug("%s: deleting it\n",
+ zlog_debug("%s: deleting it",
__func__);
bgp_aggregate_decrement(bgp_vpn, &bn->p,
bpi, afi, safi);
@@ -1352,7 +1354,10 @@ void vpn_leak_to_vrf_withdraw_all(struct bgp *bgp_vrf, /* to */
for (bpi = bgp_node_get_bgp_path_info(bn); bpi;
bpi = bpi->next) {
- if (bpi->extra && bpi->extra->bgp_orig != bgp_vrf) {
+ if (bpi->extra
+ && bpi->extra->bgp_orig != bgp_vrf
+ && bpi->extra->parent
+ && is_pi_family_vpn(bpi->extra->parent)) {
/* delete route */
bgp_aggregate_decrement(bgp_vrf, &bn->p, bpi,
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index 5b989e1853..2ef9570aac 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -226,6 +226,39 @@ static inline void vpn_leak_postchange(vpn_policy_direction_t direction,
}
}
+/* Flag if the route is injectable into VPN. This would be either a
+ * non-imported route or a non-VPN imported route.
+ */
+static inline bool is_route_injectable_into_vpn(struct bgp_path_info *pi)
+{
+ struct bgp_path_info *parent_pi;
+ struct bgp_table *table;
+ struct bgp_node *rn;
+
+ if (pi->sub_type != BGP_ROUTE_IMPORTED ||
+ !pi->extra ||
+ !pi->extra->parent)
+ return true;
+
+ parent_pi = (struct bgp_path_info *)pi->extra->parent;
+ rn = parent_pi->net;
+ if (!rn)
+ return true;
+ table = bgp_node_table(rn);
+ if (table &&
+ (table->afi == AFI_IP || table->afi == AFI_IP6) &&
+ table->safi == SAFI_MPLS_VPN)
+ return false;
+ return true;
+}
+
+/* Flag if the route path's family is VPN. */
+static inline bool is_pi_family_vpn(struct bgp_path_info *pi)
+{
+ return (is_pi_family_matching(pi, AFI_IP, SAFI_MPLS_VPN) ||
+ is_pi_family_matching(pi, AFI_IP6, SAFI_MPLS_VPN));
+}
+
extern void vpn_policy_routemap_event(const char *rmap_name);
extern vrf_id_t get_first_vrf_for_redirect_with_rt(struct ecommunity *eckey);
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 90a8f8cec5..eca632dd44 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2476,8 +2476,9 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn,
/* advertise/withdraw type-5 routes */
if ((afi == AFI_IP || afi == AFI_IP6) && (safi == SAFI_UNICAST)) {
- if (advertise_type5_routes(bgp, afi) && new_select &&
- (!new_select->extra || !new_select->extra->parent)) {
+ if (advertise_type5_routes(bgp, afi) &&
+ new_select &&
+ is_route_injectable_into_evpn(new_select)) {
/* apply the route-map */
if (bgp->adv_cmd_rmap[afi][safi].map) {
@@ -2500,8 +2501,9 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn,
afi, safi);
}
- } else if (advertise_type5_routes(bgp, afi) && old_select &&
- (!old_select->extra || !old_select->extra->parent))
+ } else if (advertise_type5_routes(bgp, afi) &&
+ old_select &&
+ is_route_injectable_into_evpn(old_select))
bgp_evpn_withdraw_type5_route(bgp, &rn->p, afi, safi);
}
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 04a3c85f2c..fc5bf0c755 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -409,6 +409,24 @@ static inline int bgp_fibupd_safi(safi_t safi)
return 0;
}
+/* Flag if the route path's family matches params. */
+static inline bool is_pi_family_matching(struct bgp_path_info *pi,
+ afi_t afi, safi_t safi)
+{
+ struct bgp_table *table;
+ struct bgp_node *rn;
+
+ rn = pi->net;
+ if (!rn)
+ return false;
+ table = bgp_node_table(rn);
+ if (table &&
+ table->afi == afi &&
+ table->safi == safi)
+ return true;
+ return false;
+}
+
/* Prototypes. */
extern void bgp_rib_remove(struct bgp_node *rn, struct bgp_path_info *pi,
struct peer *peer, afi_t afi, safi_t safi);
diff --git a/eigrpd/eigrp_fsm.c b/eigrpd/eigrp_fsm.c
index 22f5a5ddb1..4d6d73e202 100644
--- a/eigrpd/eigrp_fsm.c
+++ b/eigrpd/eigrp_fsm.c
@@ -314,7 +314,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
if (prefix->rij->count)
return EIGRP_FSM_KEEP_STATE;
- zlog_info("All reply received\n");
+ zlog_info("All reply received");
if (head->reported_distance < prefix->fdistance) {
return EIGRP_FSM_EVENT_LR_FCS;
}
@@ -344,7 +344,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
} else if (prefix->rij->count) {
return EIGRP_FSM_KEEP_STATE;
} else {
- zlog_info("All reply received\n");
+ zlog_info("All reply received");
return EIGRP_FSM_EVENT_LR;
}
} else if (msg->packet_type == EIGRP_OPC_UPDATE
@@ -366,7 +366,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
if (prefix->rij->count) {
return EIGRP_FSM_KEEP_STATE;
} else {
- zlog_info("All reply received\n");
+ zlog_info("All reply received");
if (head->reported_distance
< prefix->fdistance) {
return EIGRP_FSM_EVENT_LR_FCS;
@@ -390,7 +390,7 @@ eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
} else if (prefix->rij->count) {
return EIGRP_FSM_KEEP_STATE;
} else {
- zlog_info("All reply received\n");
+ zlog_info("All reply received");
return EIGRP_FSM_EVENT_LR;
}
} else if (msg->packet_type == EIGRP_OPC_UPDATE
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 107de47f3d..8e9302963d 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -131,7 +131,7 @@ static int process_p2p_hello(struct iih_info *iih)
if (tw_adj) {
if (tw_adj->state > ISIS_THREEWAY_DOWN) {
if (isis->debugs & DEBUG_ADJ_PACKETS) {
- zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) with invalid three-way state: %d\n",
+ zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) with invalid three-way state: %d",
iih->circuit->area->area_tag,
iih->circuit->interface->name,
tw_adj->state);
@@ -144,7 +144,7 @@ static int process_p2p_hello(struct iih_info *iih)
|| tw_adj->neighbor_circuit_id != (uint32_t) iih->circuit->idx)) {
if (isis->debugs & DEBUG_ADJ_PACKETS) {
- zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) which lists IS/Circuit different from us as neighbor.\n",
+ zlog_debug("ISIS-Adj (%s): Rcvd P2P IIH from (%s) which lists IS/Circuit different from us as neighbor.",
iih->circuit->area->area_tag,
iih->circuit->interface->name);
}
@@ -1523,7 +1523,7 @@ static int process_snp(uint8_t pdu_type, struct isis_circuit *circuit,
}
if (fabricd_initial_sync_is_complete(circuit->area) && resync_needed)
- zlog_warn("OpenFabric: Needed to resync LSPDB using CSNP!\n");
+ zlog_warn("OpenFabric: Needed to resync LSPDB using CSNP!");
retval = ISIS_OK;
out:
diff --git a/lib/vrf.c b/lib/vrf.c
index df93bc33b9..ab47f242fd 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -662,7 +662,7 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname,
"VRF %u is already configured with VRF %s\n",
vrf->vrf_id, vrf->name);
else
- zlog_info("VRF %u is already configured with VRF %s\n",
+ zlog_info("VRF %u is already configured with VRF %s",
vrf->vrf_id, vrf->name);
return CMD_WARNING_CONFIG_FAILED;
}
diff --git a/lib/zclient.c b/lib/zclient.c
index 9db1dd74f2..55f2393c56 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -2504,7 +2504,7 @@ static int zclient_read(struct thread *thread)
length -= ZEBRA_HEADER_SIZE;
if (zclient_debug)
- zlog_debug("zclient 0x%p command 0x%x VRF %u\n",
+ zlog_debug("zclient 0x%p command 0x%x VRF %u",
(void *)zclient, command, vrf_id);
switch (command) {
@@ -2574,14 +2574,14 @@ static int zclient_read(struct thread *thread)
break;
case ZEBRA_NEXTHOP_UPDATE:
if (zclient_debug)
- zlog_debug("zclient rcvd nexthop update\n");
+ zlog_debug("zclient rcvd nexthop update");
if (zclient->nexthop_update)
(*zclient->nexthop_update)(command, zclient, length,
vrf_id);
break;
case ZEBRA_IMPORT_CHECK_UPDATE:
if (zclient_debug)
- zlog_debug("zclient rcvd import check update\n");
+ zlog_debug("zclient rcvd import check update");
if (zclient->import_check_update)
(*zclient->import_check_update)(command, zclient,
length, vrf_id);
@@ -2608,7 +2608,7 @@ static int zclient_read(struct thread *thread)
break;
case ZEBRA_FEC_UPDATE:
if (zclient_debug)
- zlog_debug("zclient rcvd fec update\n");
+ zlog_debug("zclient rcvd fec update");
if (zclient->fec_update)
(*zclient->fec_update)(command, zclient, length);
break;
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 76722aad10..484e5adae6 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -138,11 +138,11 @@ static void ospf6_area_stub_update(struct ospf6_area *area)
if (IS_AREA_STUB(area)) {
if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
- zlog_debug("Stubbing out area for if %s\n", area->name);
+ zlog_debug("Stubbing out area for if %s", area->name);
OSPF6_OPT_CLEAR(area->options, OSPF6_OPT_E);
} else if (IS_AREA_ENABLED(area)) {
if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
- zlog_debug("Normal area for if %s\n", area->name);
+ zlog_debug("Normal area for if %s", area->name);
OSPF6_OPT_SET(area->options, OSPF6_OPT_E);
ospf6_asbr_send_externals_to_area(area);
}
@@ -450,7 +450,7 @@ DEFUN (area_range,
range->path.u.cost_config = cost;
- zlog_debug("%s: for prefix %s, flag = %x\n", __func__,
+ zlog_debug("%s: for prefix %s, flag = %x", __func__,
argv[idx_ipv6_prefixlen]->arg, range->flag);
if (range->rnode == NULL) {
ospf6_route_add(range, oa->range_table);
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 3153c29aa1..2795bb9abd 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1006,7 +1006,7 @@ void ospf6_asbr_send_externals_to_area(struct ospf6_area *oa)
for (ALL_LSDB(oa->ospf6->lsdb, lsa)) {
if (ntohs(lsa->header->type) == OSPF6_LSTYPE_AS_EXTERNAL) {
- zlog_debug("%s: Flooding AS-External LSA %s\n",
+ zlog_debug("%s: Flooding AS-External LSA %s",
__func__, lsa->name);
ospf6_flood_area(NULL, lsa, oa);
}
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index d4f6f6f4ae..f08426fb47 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -475,7 +475,7 @@ void ospf6_spf_calculation(uint32_t router_id,
lsa = ospf6_create_single_router_lsa(oa, oa->lsdb_self, router_id);
if (lsa == NULL) {
if (IS_OSPF6_DEBUG_SPF(PROCESS))
- zlog_debug("%s: No router LSA for area %s\n", __func__,
+ zlog_debug("%s: No router LSA for area %s", __func__,
oa->name);
return;
}
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index a3b337a0c0..f06e45392e 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -74,12 +74,12 @@ void api_opaque_lsa_print(struct lsa_header *data)
olsa = (struct opaque_lsa *)data;
opaquelen = ntohs(data->length) - OSPF_LSA_HEADER_SIZE;
- zlog_debug("apiserver_lsa_print: opaquelen=%d\n", opaquelen);
+ zlog_debug("apiserver_lsa_print: opaquelen=%d", opaquelen);
for (i = 0; i < opaquelen; i++) {
zlog_debug("0x%x ", olsa->mydata[i]);
}
- zlog_debug("\n");
+ zlog_debug(" ");
}
/* -----------------------------------------------------------
@@ -242,7 +242,7 @@ const char *ospf_api_errname(int errcode)
void msg_print(struct msg *msg)
{
if (!msg) {
- zlog_debug("msg_print msg=NULL!\n");
+ zlog_debug("msg_print msg=NULL!");
return;
}
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index d0ee818722..6b9ff6556c 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -2024,7 +2024,7 @@ int ospf_apiserver_del_if(struct interface *ifp)
/* zlog_warn for debugging */
zlog_warn("ospf_apiserver_del_if");
- zlog_warn("ifp name=%s status=%d index=%d\n", ifp->name, ifp->status,
+ zlog_warn("ifp name=%s status=%d index=%d", ifp->name, ifp->status,
ifp->ifindex);
oi = ospf_apiserver_if_lookup_by_ifp(ifp);
@@ -2110,7 +2110,7 @@ void ospf_apiserver_show_info(struct vty *vty, struct ospf_lsa *lsa)
for (i = 0; i < opaquelen; i++) {
zlog_debug("0x%x ", olsa->data[i]);
}
- zlog_debug("\n");
+ zlog_debug("");
}
return;
}
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c
index 4a0d4add15..5f01edfbdf 100644
--- a/ospfd/ospf_ri.c
+++ b/ospfd/ospf_ri.c
@@ -1372,14 +1372,14 @@ static uint16_t show_vty_sr_algorithm(struct vty *vty, struct tlv_header *tlvh)
}
else {
- zlog_debug(" Segment Routing Algorithm TLV:\n");
+ zlog_debug(" Segment Routing Algorithm TLV:");
for (i = 0; i < ntohs(algo->header.length); i++)
switch (algo->value[i]) {
case 0:
- zlog_debug(" Algorithm %d: SPF\n", i);
+ zlog_debug(" Algorithm %d: SPF", i);
break;
case 1:
- zlog_debug(" Algorithm %d: Strict SPF\n", i);
+ zlog_debug(" Algorithm %d: Strict SPF", i);
break;
default:
zlog_debug(
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index f068efc8db..c26545344a 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -901,7 +901,7 @@ static struct ospf_lsa *lsdb_lookup_next(struct ospf_area *area, uint8_t *type,
/* Sanity check, if LSA type unknwon
merley skip any LSA */
if ((i < OSPF_MIN_LSA) || (i >= OSPF_MAX_LSA)) {
- zlog_debug("Strange request with LSA type %d\n", i);
+ zlog_debug("Strange request with LSA type %d", i);
return NULL;
}
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 9c223facd3..74dba273e6 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1140,13 +1140,13 @@ ospf_rtrs_print (struct route_table *rtrs)
if (path->nexthop.s_addr == 0)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug (" directly attached to %s\r\n",
+ zlog_debug (" directly attached to %s\r",
ifindex2ifname (path->ifindex), VRF_DEFAULT);
}
else
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug (" via %s, %s\r\n",
+ zlog_debug (" via %s, %s\r",
inet_ntoa (path->nexthop),
ifindex2ifname (path->ifindex), VRF_DEFAULT);
}
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index f0ddf7cc0a..a493520868 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -1600,7 +1600,7 @@ static int ospf_sr_update_schedule(struct thread *t)
monotime(&stop_time);
if (IS_DEBUG_OSPF_SR)
- zlog_debug("SR (%s): SPF Processing Time(usecs): %lld\n",
+ zlog_debug("SR (%s): SPF Processing Time(usecs): %lld",
__func__,
(stop_time.tv_sec - start_time.tv_sec) * 1000000LL
+ (stop_time.tv_usec - start_time.tv_usec));
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index f521704f1b..012c3b4f1d 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1191,7 +1191,7 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
vty_out(vty, "Designated Router\n");
vty_out(vty, "-----------------\n");
vty_out(vty, "Address : %s\n", dr_str);
- vty_out(vty, "Priority : %d(%d)\n",
+ vty_out(vty, "Priority : %u(%d)\n",
pim_ifp->pim_dr_priority,
pim_ifp->pim_dr_num_nondrpri_neighbors);
vty_out(vty, "Uptime : %s\n", dr_uptime);
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 4b402de634..a4965b8ffe 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -97,7 +97,7 @@ void pim_register_stop_send(struct interface *ifp, struct prefix_sg *sg,
pinfo = (struct pim_interface *)ifp->info;
if (!pinfo) {
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: No pinfo!\n", __PRETTY_FUNCTION__);
+ zlog_debug("%s: No pinfo!", __PRETTY_FUNCTION__);
return;
}
if (pim_msg_send(pinfo->pim_sock_fd, src, originator, buffer,
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index e5dc6e6af6..ea32b622a6 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -90,7 +90,7 @@ static int ripng_multicast_join(struct interface *ifp)
* group on
* an interface that has just gone down.
*/
- zlog_warn("ripng join on %s EADDRINUSE (ignoring)\n",
+ zlog_warn("ripng join on %s EADDRINUSE (ignoring)",
ifp->name);
return 0; /* not an error */
}
@@ -124,7 +124,7 @@ static int ripng_multicast_leave(struct interface *ifp)
ret = setsockopt(ripng->sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
(char *)&mreq, sizeof(mreq));
if (ret < 0)
- zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s\n",
+ zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s",
safe_strerror(errno));
if (IS_RIPNG_DEBUG_EVENT)
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index a9734056bc..38d241eaa5 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -241,7 +241,7 @@ int irdp_send_thread(struct thread *t_advert)
timer = MAX_INITIAL_ADVERT_INTERVAL;
if (irdp->flags & IF_DEBUG_MISC)
- zlog_debug("IRDP: New timer for %s set to %u\n", ifp->name,
+ zlog_debug("IRDP: New timer for %s set to %u", ifp->name,
timer);
irdp->t_advertise = NULL;
diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c
index 774d84d66d..2804787620 100644
--- a/zebra/irdp_packet.c
+++ b/zebra/irdp_packet.c
@@ -166,7 +166,7 @@ static void parse_irdp_packet(char *p, int len, struct interface *ifp)
case ICMP_ROUTERSOLICIT:
if (irdp->flags & IF_DEBUG_MESSAGES)
- zlog_debug("IRDP: RX Solicit on %s from %s\n",
+ zlog_debug("IRDP: RX Solicit on %s from %s",
ifp->name, inet_ntoa(src));
process_solicit(ifp);
@@ -253,7 +253,7 @@ int irdp_read_raw(struct thread *r)
if (!(irdp->flags & IF_ACTIVE)) {
if (irdp->flags & IF_DEBUG_MISC)
- zlog_debug("IRDP: RX ICMP for disabled interface %s\n",
+ zlog_debug("IRDP: RX ICMP for disabled interface %s",
ifp->name);
return 0;
}
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 2f850c6338..c5fbfd4481 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -652,7 +652,7 @@ static void netlink_parse_extended_ack(struct nlmsghdr *h)
off = *(uint32_t *)RTA_DATA(tb[NLMSGERR_ATTR_OFFS]);
if (off > h->nlmsg_len) {
- zlog_err("Invalid offset for NLMSGERR_ATTR_OFFS\n");
+ zlog_err("Invalid offset for NLMSGERR_ATTR_OFFS");
} else if (!(h->nlmsg_flags & NLM_F_CAPPED)) {
/*
* Header of failed message
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 792756efeb..ad46191903 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -622,7 +622,7 @@ int ifm_read(struct if_msghdr *ifm)
* RTA_IFP) is required.
*/
if (!ifnlen) {
- zlog_debug("Interface index %d (new) missing ifname\n",
+ zlog_debug("Interface index %d (new) missing ifname",
ifm->ifm_index);
return -1;
}
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index c56e2f316d..cf61eb6cb4 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -835,7 +835,7 @@ int netlink_route_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
if (!(h->nlmsg_type == RTM_NEWROUTE || h->nlmsg_type == RTM_DELROUTE)) {
/* If this is not route add/delete message print warning. */
- zlog_debug("Kernel message: %s NS %u\n",
+ zlog_debug("Kernel message: %s NS %u",
nl_msg_type_to_str(h->nlmsg_type), ns_id);
return 0;
}
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 9f2bbcf426..4e97c272fb 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1456,8 +1456,8 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
&(api_nh->gate.ipv4),
sizeof(struct in_addr));
zebra_vxlan_evpn_vrf_route_add(
- vrf_id, &api_nh->rmac, &vtep_ip,
- &api.prefix);
+ api_nh->vrf_id, &api_nh->rmac,
+ &vtep_ip, &api.prefix);
}
break;
case NEXTHOP_TYPE_IPV6:
@@ -1479,8 +1479,8 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6),
sizeof(struct in6_addr));
zebra_vxlan_evpn_vrf_route_add(
- vrf_id, &api_nh->rmac, &vtep_ip,
- &api.prefix);
+ api_nh->vrf_id, &api_nh->rmac,
+ &vtep_ip, &api.prefix);
}
break;
case NEXTHOP_TYPE_BLACKHOLE:
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index cc5e38e690..bb352dc2ff 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -328,7 +328,7 @@ DEFUN (zebra_ptm_enable_if,
if (!old_ptm_enable && ptm_cb.ptm_enable) {
if (!if_is_operative(ifp) && send_linkdown) {
if (IS_ZEBRA_DEBUG_EVENT)
- zlog_debug("%s: Bringing down interface %s\n",
+ zlog_debug("%s: Bringing down interface %s",
__func__, ifp->name);
if_down(ifp);
}
@@ -354,7 +354,7 @@ DEFUN (no_zebra_ptm_enable_if,
ifp->ptm_enable = ZEBRA_IF_PTM_ENABLE_OFF;
if (if_is_no_ptm_operative(ifp) && send_linkup) {
if (IS_ZEBRA_DEBUG_EVENT)
- zlog_debug("%s: Bringing up interface %s\n",
+ zlog_debug("%s: Bringing up interface %s",
__func__, ifp->name);
if_up(ifp);
}
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 52637c6062..f601ab7e7b 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -383,7 +383,7 @@ static void zebra_rnh_eval_import_check_entry(vrf_id_t vrfid, afi_t afi,
if (state_changed || force) {
if (IS_ZEBRA_DEBUG_NHT) {
prefix2str(&nrn->p, bufn, INET6_ADDRSTRLEN);
- zlog_debug("%u:%s: Route import check %s %s\n", vrfid,
+ zlog_debug("%u:%s: Route import check %s %s", vrfid,
bufn, rnh->state ? "passed" : "failed",
state_changed ? "(state changed)" : "");
}
@@ -775,7 +775,7 @@ void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
table = get_rnh_table(vrfid, afi, type);
if (!table) {
- zlog_debug("print_rnhs: rnh table not found\n");
+ zlog_debug("print_rnhs: rnh table not found");
return;
}
@@ -1025,7 +1025,7 @@ static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi,
ntable = get_rnh_table(vrf_id, afi, type);
if (!ntable) {
- zlog_debug("cleanup_rnh_client: rnh table not found\n");
+ zlog_debug("cleanup_rnh_client: rnh table not found");
return -1;
}