@ -1,33 +0,0 @@ | |||
From 0b7086494e9fe056f35560bcab53ff9eb0e68df4 Mon Sep 17 00:00:00 2001 | |||
From: Mark Stapp <mjs@voltanet.io> | |||
Date: Wed, 19 Feb 2020 08:44:05 -0500 | |||
Subject: [PATCH] zebra: fix missing route-advert stubs | |||
Stubs are used when frr is built without route-advert | |||
support; a couple of apis were missing, causing builds to fail. | |||
Signed-off-by: Mark Stapp <mjs@voltanet.io> | |||
--- | |||
zebra/rtadv.c | 11 +++++++++++ | |||
1 file changed, 11 insertions(+) | |||
diff --git a/zebra/rtadv.c b/zebra/rtadv.c | |||
index e9a97d4b15..c710978d78 100644 | |||
--- a/zebra/rtadv.c | |||
+++ b/zebra/rtadv.c | |||
@@ -2399,4 +2399,15 @@ void rtadv_cmd_init(void) | |||
{ | |||
/* Empty.*/; | |||
} | |||
+ | |||
+void rtadv_stop_ra(struct interface *ifp) | |||
+{ | |||
+ /* Empty.*/; | |||
+} | |||
+ | |||
+void rtadv_stop_ra_all(void) | |||
+{ | |||
+ /* Empty.*/; | |||
+} | |||
+ | |||
#endif /* HAVE_RTADV */ |
@ -1,218 +0,0 @@ | |||
From 2b5eda4c0539dcd30a06c975be36f879cc454e9f Mon Sep 17 00:00:00 2001 | |||
From: Donald Sharp <sharpd@cumulusnetworks.com> | |||
Date: Mon, 10 Feb 2020 19:25:52 -0500 | |||
Subject: [PATCH 1/3] bgpd: Update failed reason to distinguish some NHT | |||
scenarios | |||
Current failed reasons for bgp when you have a peer that | |||
is not online yet is `Waiting for NHT`, even if NHT has | |||
succeeded. Add some code to differentiate this. | |||
eva# show bgp ipv4 uni summ failed | |||
BGP router identifier 192.168.201.135, local AS number 3923 vrf-id 0 | |||
BGP table version 0 | |||
RIB entries 0, using 0 bytes of memory | |||
Peers 2, using 43 KiB of memory | |||
Neighbor EstdCnt DropCnt ResetTime Reason | |||
192.168.44.1 0 0 never Waiting for NHT | |||
192.168.201.139 0 0 never Waiting for Open to Succeed | |||
Total number of neighbors 2 | |||
eva# | |||
eva# show bgp nexthop | |||
Current BGP nexthop cache: | |||
192.168.44.1 invalid, peer 192.168.44.1 | |||
Must be Connected | |||
Last update: Mon Feb 10 19:05:19 2020 | |||
192.168.201.139 valid [IGP metric 0], #paths 0, peer 192.168.201.139 | |||
So 192.168.201.139 is a peer for a connected route that has not been | |||
created on .139, while 44.1 nexthop tracking has not succeeded yet. | |||
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> | |||
--- | |||
bgpd/bgp_fsm.c | 4 +++- | |||
bgpd/bgp_nht.c | 23 ++++++++++++++++------- | |||
bgpd/bgpd.h | 12 +++++++++--- | |||
3 files changed, 28 insertions(+), 11 deletions(-) | |||
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c | |||
index 3667dae83d..107e9fc892 100644 | |||
--- a/bgpd/bgp_fsm.c | |||
+++ b/bgpd/bgp_fsm.c | |||
@@ -560,7 +560,9 @@ const char *const peer_down_str[] = {"", | |||
"Waiting for NHT", | |||
"Waiting for Peer IPv6 LLA", | |||
"Waiting for VRF to be initialized", | |||
- "No AFI/SAFI activated for peer"}; | |||
+ "No AFI/SAFI activated for peer", | |||
+ "AS Set config change", | |||
+ "Waiting for peer OPEN"}; | |||
static int bgp_graceful_restart_timer_expire(struct thread *thread) | |||
{ | |||
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c | |||
index a50fc7d697..e9496e47a9 100644 | |||
--- a/bgpd/bgp_nht.c | |||
+++ b/bgpd/bgp_nht.c | |||
@@ -788,13 +788,22 @@ static void evaluate_paths(struct bgp_nexthop_cache *bnc) | |||
bgp_process(bgp_path, rn, afi, safi); | |||
} | |||
- if (peer && !CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED)) { | |||
- if (BGP_DEBUG(nht, NHT)) | |||
- zlog_debug("%s: Updating peer (%s(%s)) status with NHT", | |||
- __FUNCTION__, peer->host, | |||
- peer->bgp->name_pretty); | |||
- bgp_fsm_event_update(peer, bgp_isvalid_nexthop(bnc)); | |||
- SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED); | |||
+ if (peer) { | |||
+ int valid_nexthops = bgp_isvalid_nexthop(bnc); | |||
+ | |||
+ if (valid_nexthops) | |||
+ peer->last_reset = PEER_DOWN_WAITING_OPEN; | |||
+ else | |||
+ peer->last_reset = PEER_DOWN_WAITING_NHT; | |||
+ | |||
+ if (!CHECK_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED)) { | |||
+ if (BGP_DEBUG(nht, NHT)) | |||
+ zlog_debug("%s: Updating peer (%s(%s)) status with NHT", | |||
+ __FUNCTION__, peer->host, | |||
+ peer->bgp->name_pretty); | |||
+ bgp_fsm_event_update(peer, valid_nexthops); | |||
+ SET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED); | |||
+ } | |||
} | |||
RESET_FLAG(bnc->change_flags); | |||
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h | |||
index 7d81579009..66d7633553 100644 | |||
--- a/bgpd/bgpd.h | |||
+++ b/bgpd/bgpd.h | |||
@@ -1185,10 +1185,10 @@ struct peer { | |||
#define PEER_DOWN_REMOTE_AS_CHANGE 2 /* neighbor remote-as command */ | |||
#define PEER_DOWN_LOCAL_AS_CHANGE 3 /* neighbor local-as command */ | |||
#define PEER_DOWN_CLID_CHANGE 4 /* bgp cluster-id command */ | |||
-#define PEER_DOWN_CONFED_ID_CHANGE 5 /* bgp confederation identifier command */ | |||
+#define PEER_DOWN_CONFED_ID_CHANGE 5 /* bgp confederation id command */ | |||
#define PEER_DOWN_CONFED_PEER_CHANGE 6 /* bgp confederation peer command */ | |||
-#define PEER_DOWN_RR_CLIENT_CHANGE 7 /* neighbor route-reflector-client command */ | |||
-#define PEER_DOWN_RS_CLIENT_CHANGE 8 /* neighbor route-server-client command */ | |||
+#define PEER_DOWN_RR_CLIENT_CHANGE 7 /* neighbor rr-client command */ | |||
+#define PEER_DOWN_RS_CLIENT_CHANGE 8 /* neighbor rs-client command */ | |||
#define PEER_DOWN_UPDATE_SOURCE_CHANGE 9 /* neighbor update-source command */ | |||
#define PEER_DOWN_AF_ACTIVATE 10 /* neighbor activate command */ | |||
#define PEER_DOWN_USER_SHUTDOWN 11 /* neighbor shutdown command */ | |||
@@ -1212,6 +1212,12 @@ struct peer { | |||
#define PEER_DOWN_VRF_UNINIT 29 /* Associated VRF is not init yet */ | |||
#define PEER_DOWN_NOAFI_ACTIVATED 30 /* No AFI/SAFI activated for peer */ | |||
#define PEER_DOWN_AS_SETS_REJECT 31 /* Reject routes with AS_SET */ | |||
+#define PEER_DOWN_WAITING_OPEN 32 /* Waiting for open to succeed */ | |||
+ /* | |||
+ * Remember to update peer_down_str in bgp_fsm.c when you add | |||
+ * a new value to the last_reset reason | |||
+ */ | |||
+ | |||
size_t last_reset_cause_size; | |||
uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE]; | |||
From 4098f79949dd0e1e4ed7b89df8dc9b2be81fa9d6 Mon Sep 17 00:00:00 2001 | |||
From: Donatas Abraitis <donatas.abraitis@gmail.com> | |||
Date: Fri, 14 Feb 2020 23:21:55 +0200 | |||
Subject: [PATCH 2/3] bgpd: Show the real reason why the peer is failed | |||
If the peer was shutdown locally, it doesn't show up as admin. shutdown. | |||
Instead it's treated as "Waiting for peer OPEN". | |||
The same applies to when the peer reaches maximum-prefix count. | |||
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com> | |||
--- | |||
bgpd/bgp_fsm.c | 7 ++++++- | |||
bgpd/bgpd.h | 1 + | |||
2 files changed, 7 insertions(+), 1 deletion(-) | |||
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c | |||
index 107e9fc892..c920c4e501 100644 | |||
--- a/bgpd/bgp_fsm.c | |||
+++ b/bgpd/bgp_fsm.c | |||
@@ -562,7 +562,8 @@ const char *const peer_down_str[] = {"", | |||
"Waiting for VRF to be initialized", | |||
"No AFI/SAFI activated for peer", | |||
"AS Set config change", | |||
- "Waiting for peer OPEN"}; | |||
+ "Waiting for peer OPEN", | |||
+ "Reached received prefix count"}; | |||
static int bgp_graceful_restart_timer_expire(struct thread *thread) | |||
{ | |||
@@ -1431,6 +1432,10 @@ int bgp_start(struct peer *peer) | |||
"%s [FSM] Trying to start suppressed peer" | |||
" - this is never supposed to happen!", | |||
peer->host); | |||
+ if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN)) | |||
+ peer->last_reset = PEER_DOWN_USER_SHUTDOWN; | |||
+ else if (CHECK_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW)) | |||
+ peer->last_reset = PEER_DOWN_PFX_COUNT; | |||
return -1; | |||
} | |||
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h | |||
index 66d7633553..49e2a537fd 100644 | |||
--- a/bgpd/bgpd.h | |||
+++ b/bgpd/bgpd.h | |||
@@ -1213,6 +1213,7 @@ struct peer { | |||
#define PEER_DOWN_NOAFI_ACTIVATED 30 /* No AFI/SAFI activated for peer */ | |||
#define PEER_DOWN_AS_SETS_REJECT 31 /* Reject routes with AS_SET */ | |||
#define PEER_DOWN_WAITING_OPEN 32 /* Waiting for open to succeed */ | |||
+#define PEER_DOWN_PFX_COUNT 33 /* Reached received prefix count */ | |||
/* | |||
* Remember to update peer_down_str in bgp_fsm.c when you add | |||
* a new value to the last_reset reason | |||
From 540528864d85a3b00e0794da769497ecfb8e0c27 Mon Sep 17 00:00:00 2001 | |||
From: Donatas Abraitis <donatas.abraitis@gmail.com> | |||
Date: Tue, 11 Feb 2020 18:02:19 +0200 | |||
Subject: [PATCH 3/3] bgpd: Format properly `show bgp summary failed` | |||
Before: | |||
``` | |||
Neighbor EstdCnt DropCnt ResetTime Reason | |||
192.168.0.1 0 0 never Waiting for peer OPEN | |||
``` | |||
After: | |||
``` | |||
Neighbor EstdCnt DropCnt ResetTime Reason | |||
192.168.0.1 0 0 never Waiting for peer OPEN | |||
``` | |||
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com> | |||
--- | |||
bgpd/bgp_vty.c | 4 ++-- | |||
1 file changed, 2 insertions(+), 2 deletions(-) | |||
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c | |||
index 53d9732956..243822206c 100644 | |||
--- a/bgpd/bgp_vty.c | |||
+++ b/bgpd/bgp_vty.c | |||
@@ -8063,7 +8063,7 @@ static void bgp_show_peer_reset(struct vty * vty, struct peer *peer, | |||
: "received", | |||
code_str, subcode_str); | |||
} else { | |||
- vty_out(vty, " %s\n", | |||
+ vty_out(vty, " %s\n", | |||
peer_down_str[(int)peer->last_reset]); | |||
} | |||
} | |||
@@ -8119,7 +8119,7 @@ static void bgp_show_failed_summary(struct vty *vty, struct bgp *bgp, | |||
if (len < max_neighbor_width) | |||
vty_out(vty, "%*s", max_neighbor_width - len, | |||
" "); | |||
- vty_out(vty, "%7d %7d %8s", peer->established, | |||
+ vty_out(vty, "%7d %7d %9s", peer->established, | |||
peer->dropped, | |||
peer_uptime(peer->uptime, timebuf, | |||
BGP_UPTIME_LEN, 0, NULL)); |
@ -1,177 +0,0 @@ | |||
From 33a9ff0045adfa605832187e570dbe1374ceb22e Mon Sep 17 00:00:00 2001 | |||
From: Mark Stapp <mjs@voltanet.io> | |||
Date: Tue, 28 Jan 2020 11:00:42 -0500 | |||
Subject: [PATCH] zebra: add config to disable use of kernel nexthops | |||
Add a config that disables use of kernel-level nexthop ids. | |||
Currently, zebra always uses nexthop ids if the kernel supports | |||
them. | |||
Signed-off-by: Mark Stapp <mjs@voltanet.io> | |||
--- | |||
zebra/rt_netlink.c | 20 ++++++++++++++++---- | |||
zebra/zebra_nhg.c | 18 ++++++++++++++++++ | |||
zebra/zebra_nhg.h | 10 +++++++++- | |||
zebra/zebra_vty.c | 18 ++++++++++++++++++ | |||
4 files changed, 61 insertions(+), 5 deletions(-) | |||
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c | |||
index 2abcd6ef2a..705536595b 100644 | |||
--- a/zebra/rt_netlink.c | |||
+++ b/zebra/rt_netlink.c | |||
@@ -75,6 +75,10 @@ | |||
static vlanid_t filter_vlan = 0; | |||
+/* We capture whether the current kernel supports nexthop ids; by | |||
+ * default, we'll use them if possible. There's also a configuration | |||
+ * available to _disable_ use of kernel nexthops. | |||
+ */ | |||
static bool supports_nh; | |||
struct gw_family_t { | |||
@@ -86,6 +90,12 @@ struct gw_family_t { | |||
static const char ipv4_ll_buf[16] = "169.254.0.1"; | |||
static struct in_addr ipv4_ll; | |||
+/* Helper to control use of kernel-level nexthop ids */ | |||
+static bool kernel_nexthops_supported(void) | |||
+{ | |||
+ return (supports_nh && zebra_nhg_kernel_nexthops_enabled()); | |||
+} | |||
+ | |||
/* | |||
* The ipv4_ll data structure is used for all 5549 | |||
* additions to the kernel. Let's figure out the | |||
@@ -1628,7 +1638,7 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) | |||
RTA_PAYLOAD(rta)); | |||
} | |||
- if (supports_nh) { | |||
+ if (kernel_nexthops_supported()) { | |||
/* Kernel supports nexthop objects */ | |||
addattr32(&req.n, sizeof(req), RTA_NH_ID, | |||
dplane_ctx_get_nhe_id(ctx)); | |||
@@ -1943,7 +1953,7 @@ static int netlink_nexthop(int cmd, struct zebra_dplane_ctx *ctx) | |||
size_t req_size = sizeof(req); | |||
/* Nothing to do if the kernel doesn't support nexthop objects */ | |||
- if (!supports_nh) | |||
+ if (!kernel_nexthops_supported()) | |||
return 0; | |||
label_buf[0] = '\0'; | |||
@@ -2504,8 +2514,10 @@ int netlink_nexthop_read(struct zebra_ns *zns) | |||
* this kernel must support them. | |||
*/ | |||
supports_nh = true; | |||
- else if (IS_ZEBRA_DEBUG_KERNEL) | |||
- zlog_debug("Nexthop objects not supported on this kernel"); | |||
+ | |||
+ if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_NHG) | |||
+ zlog_debug("Nexthop objects %ssupported on this kernel", | |||
+ supports_nh ? "" : "not "); | |||
return ret; | |||
} | |||
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c | |||
index cbeb73aed4..62c478cf85 100644 | |||
--- a/zebra/zebra_nhg.c | |||
+++ b/zebra/zebra_nhg.c | |||
@@ -49,6 +49,9 @@ DEFINE_MTYPE_STATIC(ZEBRA, NHG_CTX, "Nexthop Group Context"); | |||
/* id counter to keep in sync with kernel */ | |||
uint32_t id_counter; | |||
+/* */ | |||
+static bool g_nexthops_enabled = true; | |||
+ | |||
static struct nhg_hash_entry *depends_find(const struct nexthop *nh, | |||
afi_t afi); | |||
static void depends_add(struct nhg_connected_tree_head *head, | |||
@@ -2004,3 +2007,18 @@ void zebra_nhg_sweep_table(struct hash *hash) | |||
{ | |||
hash_iterate(hash, zebra_nhg_sweep_entry, NULL); | |||
} | |||
+ | |||
+/* Global control to disable use of kernel nexthops, if available. We can't | |||
+ * force the kernel to support nexthop ids, of course, but we can disable | |||
+ * zebra's use of them, for testing e.g. By default, if the kernel supports | |||
+ * nexthop ids, zebra uses them. | |||
+ */ | |||
+void zebra_nhg_enable_kernel_nexthops(bool set) | |||
+{ | |||
+ g_nexthops_enabled = set; | |||
+} | |||
+ | |||
+bool zebra_nhg_kernel_nexthops_enabled(void) | |||
+{ | |||
+ return g_nexthops_enabled; | |||
+} | |||
diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h | |||
index c2e173e094..4d001944b7 100644 | |||
--- a/zebra/zebra_nhg.h | |||
+++ b/zebra/zebra_nhg.h | |||
@@ -153,6 +153,13 @@ struct nhg_ctx { | |||
enum nhg_ctx_status status; | |||
}; | |||
+/* Global control to disable use of kernel nexthops, if available. We can't | |||
+ * force the kernel to support nexthop ids, of course, but we can disable | |||
+ * zebra's use of them, for testing e.g. By default, if the kernel supports | |||
+ * nexthop ids, zebra uses them. | |||
+ */ | |||
+void zebra_nhg_enable_kernel_nexthops(bool set); | |||
+bool zebra_nhg_kernel_nexthops_enabled(void); | |||
/** | |||
* NHE abstracted tree functions. | |||
@@ -227,4 +234,5 @@ extern void zebra_nhg_sweep_table(struct hash *hash); | |||
/* Nexthop resolution processing */ | |||
struct route_entry; /* Forward ref to avoid circular includes */ | |||
extern int nexthop_active_update(struct route_node *rn, struct route_entry *re); | |||
-#endif | |||
+ | |||
+#endif /* __ZEBRA_NHG_H__ */ | |||
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c | |||
index 78001da170..866b38b47e 100644 | |||
--- a/zebra/zebra_vty.c | |||
+++ b/zebra/zebra_vty.c | |||
@@ -1410,6 +1410,19 @@ DEFPY (show_nexthop_group, | |||
return CMD_SUCCESS; | |||
} | |||
+DEFPY_HIDDEN(nexthop_group_use_enable, | |||
+ nexthop_group_use_enable_cmd, | |||
+ "[no] zebra nexthop kernel enable", | |||
+ NO_STR | |||
+ ZEBRA_STR | |||
+ "Nexthop configuration \n" | |||
+ "Configure use of kernel nexthops\n" | |||
+ "Enable kernel nexthops\n") | |||
+{ | |||
+ zebra_nhg_enable_kernel_nexthops(!no); | |||
+ return CMD_SUCCESS; | |||
+} | |||
+ | |||
DEFUN (no_ip_nht_default_route, | |||
no_ip_nht_default_route_cmd, | |||
"no ip nht resolve-via-default", | |||
@@ -3121,6 +3134,10 @@ static int config_write_protocol(struct vty *vty) | |||
/* Include dataplane info */ | |||
dplane_config_write_helper(vty); | |||
+ /* Include nexthop-group config */ | |||
+ if (!zebra_nhg_kernel_nexthops_enabled()) | |||
+ vty_out(vty, "no zebra nexthop kernel enable\n"); | |||
+ | |||
return 1; | |||
} | |||
@@ -3492,6 +3509,7 @@ void zebra_vty_init(void) | |||
install_element(CONFIG_NODE, &no_zebra_workqueue_timer_cmd); | |||
install_element(CONFIG_NODE, &zebra_packet_process_cmd); | |||
install_element(CONFIG_NODE, &no_zebra_packet_process_cmd); | |||
+ install_element(CONFIG_NODE, &nexthop_group_use_enable_cmd); | |||
install_element(VIEW_NODE, &show_nexthop_group_cmd); | |||
install_element(VIEW_NODE, &show_interface_nexthop_group_cmd); |
@ -1,166 +0,0 @@ | |||
From b49789f5d32429722542a1a7de4b371b43958a31 Mon Sep 17 00:00:00 2001 | |||
From: Donald Sharp <sharpd@cumulusnetworks.com> | |||
Date: Wed, 18 Mar 2020 22:30:28 -0400 | |||
Subject: [PATCH] yang: Partially revert code to restore functionality | |||
Partially revert code from commit: | |||
f22b9250853229c93617ffdad139a4762f5f7348 | |||
since this broke passive-interface, network and offset-list | |||
commands in rip and ripng | |||
Fixes: #6001 | |||
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> | |||
--- | |||
yang/frr-eigrpd.yang | 9 +++------ | |||
yang/frr-ripd.yang | 27 ++++++++++----------------- | |||
yang/frr-ripngd.yang | 23 +++++++---------------- | |||
3 files changed, 20 insertions(+), 39 deletions(-) | |||
diff --git a/yang/frr-eigrpd.yang b/yang/frr-eigrpd.yang | |||
index 0c62954570..853d823880 100644 | |||
--- a/yang/frr-eigrpd.yang | |||
+++ b/yang/frr-eigrpd.yang | |||
@@ -23,11 +23,6 @@ module frr-eigrpd { | |||
description | |||
"This module defines a model for managing FRR eigrpd daemon."; | |||
- revision 2019-09-09 { | |||
- description | |||
- "Changed interface references to use | |||
- frr-interface:interface-ref typedef"; | |||
- } | |||
revision 2019-06-19 { | |||
description "Initial revision."; | |||
reference | |||
@@ -99,7 +94,9 @@ module frr-eigrpd { | |||
leaf-list passive-interface { | |||
description "List of suppressed interfaces"; | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
} | |||
leaf active-time { | |||
diff --git a/yang/frr-ripd.yang b/yang/frr-ripd.yang | |||
index 94a9ebf3e1..07690793f0 100644 | |||
--- a/yang/frr-ripd.yang | |||
+++ b/yang/frr-ripd.yang | |||
@@ -24,11 +24,6 @@ module frr-ripd { | |||
description | |||
"This module defines a model for managing FRR ripd daemon."; | |||
- revision 2019-09-09 { | |||
- description | |||
- "Changed interface references to use | |||
- frr-interface:interface-ref typedef"; | |||
- } | |||
revision 2017-12-06 { | |||
description | |||
"Initial revision."; | |||
@@ -118,7 +113,9 @@ module frr-ripd { | |||
"Enable RIP on the specified IP network."; | |||
} | |||
leaf-list interface { | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
description | |||
"Enable RIP on the specified interface."; | |||
} | |||
@@ -127,15 +124,7 @@ module frr-ripd { | |||
description | |||
"Offset-list to modify route metric."; | |||
leaf interface { | |||
- type union { | |||
- type frr-interface:interface-ref; | |||
- type enumeration { | |||
- enum '*' { | |||
- description | |||
- "Match all interfaces."; | |||
- } | |||
- } | |||
- } | |||
+ type string; | |||
description | |||
"Interface to match. Use '*' to match all interfaces."; | |||
} | |||
@@ -179,14 +168,18 @@ module frr-ripd { | |||
} | |||
leaf-list passive-interface { | |||
when "../passive-default = 'false'"; | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
description | |||
"A list of interfaces where the sending of RIP packets | |||
is disabled."; | |||
} | |||
leaf-list non-passive-interface { | |||
when "../passive-default = 'true'"; | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
description | |||
"A list of interfaces where the sending of RIP packets | |||
is enabled."; | |||
diff --git a/yang/frr-ripngd.yang b/yang/frr-ripngd.yang | |||
index 831758af86..b341b438a4 100644 | |||
--- a/yang/frr-ripngd.yang | |||
+++ b/yang/frr-ripngd.yang | |||
@@ -24,11 +24,6 @@ module frr-ripngd { | |||
description | |||
"This module defines a model for managing FRR ripngd daemon."; | |||
- revision 2019-09-09 { | |||
- description | |||
- "Changed interface references to use | |||
- frr-interface:interface-ref typedef"; | |||
- } | |||
revision 2018-11-27 { | |||
description | |||
"Initial revision."; | |||
@@ -76,7 +71,9 @@ module frr-ripngd { | |||
"Enable RIPng on the specified IPv6 network."; | |||
} | |||
leaf-list interface { | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
description | |||
"Enable RIPng on the specified interface."; | |||
} | |||
@@ -85,15 +82,7 @@ module frr-ripngd { | |||
description | |||
"Offset-list to modify route metric."; | |||
leaf interface { | |||
- type union { | |||
- type frr-interface:interface-ref; | |||
- type enumeration { | |||
- enum '*' { | |||
- description | |||
- "Match all interfaces."; | |||
- } | |||
- } | |||
- } | |||
+ type string; | |||
description | |||
"Interface to match. Use '*' to match all interfaces."; | |||
} | |||
@@ -129,7 +118,9 @@ module frr-ripngd { | |||
} | |||
} | |||
leaf-list passive-interface { | |||
- type frr-interface:interface-ref; | |||
+ type string { | |||
+ length "1..16"; | |||
+ } | |||
description | |||
"A list of interfaces where the sending of RIPng packets | |||
is disabled."; |
@ -1,174 +0,0 @@ | |||
From c9d7f8c0126b7b078b06f36096a2b3bbbc1f63b4 Mon Sep 17 00:00:00 2001 | |||
From: Stephen Worley <sworley@cumulusnetworks.com> | |||
Date: Tue, 24 Mar 2020 17:10:08 -0400 | |||
Subject: [PATCH 1/2] zebra: abstract route src determiniation into func | |||
Abstraction the route src determination from a nexthop in the | |||
netlink code into a function for both singlepath and mutlipath | |||
to call. | |||
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com> | |||
(cherry picked from commit 762288f50f5fa29512864fcc7814be83e1b58ff4) | |||
--- | |||
zebra/rt_netlink.c | 81 ++++++++++++++++------------------------------ | |||
1 file changed, 28 insertions(+), 53 deletions(-) | |||
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c | |||
index 705536595b..dcaf2155f0 100644 | |||
--- a/zebra/rt_netlink.c | |||
+++ b/zebra/rt_netlink.c | |||
@@ -1513,6 +1513,30 @@ static int netlink_neigh_update(int cmd, int ifindex, uint32_t addr, char *lla, | |||
0); | |||
} | |||
+static bool nexthop_set_src(const struct nexthop *nexthop, int family, | |||
+ union g_addr *src) | |||
+{ | |||
+ if (family == AF_INET) { | |||
+ if (nexthop->rmap_src.ipv4.s_addr != INADDR_ANY) { | |||
+ src->ipv4 = nexthop->rmap_src.ipv4; | |||
+ return true; | |||
+ } else if (nexthop->src.ipv4.s_addr != INADDR_ANY) { | |||
+ src->ipv4 = nexthop->src.ipv4; | |||
+ return true; | |||
+ } | |||
+ } else if (family == AF_INET6) { | |||
+ if (!IN6_IS_ADDR_UNSPECIFIED(&nexthop->rmap_src.ipv6)) { | |||
+ src->ipv6 = nexthop->rmap_src.ipv6; | |||
+ return true; | |||
+ } else if (!IN6_IS_ADDR_UNSPECIFIED(&nexthop->src.ipv6)) { | |||
+ src->ipv6 = nexthop->src.ipv6; | |||
+ return true; | |||
+ } | |||
+ } | |||
+ | |||
+ return false; | |||
+} | |||
+ | |||
/* | |||
* Routing table change via netlink interface, using a dataplane context object | |||
*/ | |||
@@ -1523,7 +1547,7 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) | |||
unsigned int nexthop_num; | |||
int family; | |||
const char *routedesc; | |||
- int setsrc = 0; | |||
+ bool setsrc = false; | |||
union g_addr src; | |||
const struct prefix *p, *src_p; | |||
uint32_t table_id; | |||
@@ -1689,32 +1713,8 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) | |||
if (setsrc) | |||
continue; | |||
- if (family == AF_INET) { | |||
- if (nexthop->rmap_src.ipv4.s_addr | |||
- != 0) { | |||
- src.ipv4 = | |||
- nexthop->rmap_src.ipv4; | |||
- setsrc = 1; | |||
- } else if (nexthop->src.ipv4.s_addr | |||
- != 0) { | |||
- src.ipv4 = | |||
- nexthop->src.ipv4; | |||
- setsrc = 1; | |||
- } | |||
- } else if (family == AF_INET6) { | |||
- if (!IN6_IS_ADDR_UNSPECIFIED( | |||
- &nexthop->rmap_src.ipv6)) { | |||
- src.ipv6 = | |||
- nexthop->rmap_src.ipv6; | |||
- setsrc = 1; | |||
- } else if ( | |||
- !IN6_IS_ADDR_UNSPECIFIED( | |||
- &nexthop->src.ipv6)) { | |||
- src.ipv6 = | |||
- nexthop->src.ipv6; | |||
- setsrc = 1; | |||
- } | |||
- } | |||
+ setsrc = nexthop_set_src(nexthop, family, &src); | |||
+ | |||
continue; | |||
} | |||
@@ -1757,32 +1757,7 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) | |||
if (setsrc) | |||
continue; | |||
- if (family == AF_INET) { | |||
- if (nexthop->rmap_src.ipv4.s_addr | |||
- != 0) { | |||
- src.ipv4 = | |||
- nexthop->rmap_src.ipv4; | |||
- setsrc = 1; | |||
- } else if (nexthop->src.ipv4.s_addr | |||
- != 0) { | |||
- src.ipv4 = | |||
- nexthop->src.ipv4; | |||
- setsrc = 1; | |||
- } | |||
- } else if (family == AF_INET6) { | |||
- if (!IN6_IS_ADDR_UNSPECIFIED( | |||
- &nexthop->rmap_src.ipv6)) { | |||
- src.ipv6 = | |||
- nexthop->rmap_src.ipv6; | |||
- setsrc = 1; | |||
- } else if ( | |||
- !IN6_IS_ADDR_UNSPECIFIED( | |||
- &nexthop->src.ipv6)) { | |||
- src.ipv6 = | |||
- nexthop->src.ipv6; | |||
- setsrc = 1; | |||
- } | |||
- } | |||
+ setsrc = nexthop_set_src(nexthop, family, &src); | |||
continue; | |||
} | |||
From e85c67d05decf340dcf5663a48c652719d04387f Mon Sep 17 00:00:00 2001 | |||
From: Stephen Worley <sworley@cumulusnetworks.com> | |||
Date: Tue, 24 Mar 2020 17:32:21 -0400 | |||
Subject: [PATCH 2/2] zebra: determine src when using nexthop objects | |||
Determine src based on nexthop data even when we are using | |||
kernel nexthop objects. | |||
Before, we were entirely skipping this step and just sending the | |||
nexthop ID, ignoring src determination. | |||
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com> | |||
(cherry picked from commit d8bfd8dc9a899f841967257a6b5f30910fdc17c8) | |||
--- | |||
zebra/rt_netlink.c | 17 +++++++++++++++++ | |||
1 file changed, 17 insertions(+) | |||
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c | |||
index dcaf2155f0..ee8ef6558f 100644 | |||
--- a/zebra/rt_netlink.c | |||
+++ b/zebra/rt_netlink.c | |||
@@ -1666,6 +1666,23 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) | |||
/* Kernel supports nexthop objects */ | |||
addattr32(&req.n, sizeof(req), RTA_NH_ID, | |||
dplane_ctx_get_nhe_id(ctx)); | |||
+ | |||
+ /* Have to determine src still */ | |||
+ for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), nexthop)) { | |||
+ if (setsrc) | |||
+ break; | |||
+ | |||
+ setsrc = nexthop_set_src(nexthop, family, &src); | |||
+ } | |||
+ | |||
+ if (setsrc) { | |||
+ if (family == AF_INET) | |||
+ addattr_l(&req.n, sizeof(req), RTA_PREFSRC, | |||
+ &src.ipv4, bytelen); | |||
+ else if (family == AF_INET6) | |||
+ addattr_l(&req.n, sizeof(req), RTA_PREFSRC, | |||
+ &src.ipv6, bytelen); | |||
+ } | |||
goto skip; | |||
} | |||
@ -1,61 +0,0 @@ | |||
From 7cc9f2c7953d48cfb70b7e0c1b0c57e45ae68ce8 Mon Sep 17 00:00:00 2001 | |||
From: Stephen Worley <sworley@cumulusnetworks.com> | |||
Date: Wed, 1 Apr 2020 15:31:40 -0400 | |||
Subject: [PATCH] zebra: free unhashable (dup) NHEs via ID table cleanup | |||
Free unhashable (duplicate NHEs from the kernel) via ID table | |||
cleanup. Since the NHE ID hash table contains extra entries, | |||
that's the one we need to be calling zebra_nhg_hash_free() | |||
on, otherwise we will never free the unhashable NHEs. | |||
This was found via a memleak: | |||
==1478713== HEAP SUMMARY: | |||
==1478713== in use at exit: 10,267 bytes in 46 blocks | |||
==1478713== total heap usage: 76,810 allocs, 76,764 frees, 3,901,237 bytes allocated | |||
==1478713== | |||
==1478713== 208 (88 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 35 of 41 | |||
==1478713== at 0x483BB1A: calloc (vg_replace_malloc.c:762) | |||
==1478713== by 0x48E35E8: qcalloc (memory.c:110) | |||
==1478713== by 0x451CCB: zebra_nhg_alloc (zebra_nhg.c:369) | |||
==1478713== by 0x453DE3: zebra_nhg_copy (zebra_nhg.c:379) | |||
==1478713== by 0x452670: nhg_ctx_process_new (zebra_nhg.c:1143) | |||
==1478713== by 0x4523A8: nhg_ctx_process (zebra_nhg.c:1234) | |||
==1478713== by 0x452A2D: zebra_nhg_kernel_find (zebra_nhg.c:1294) | |||
==1478713== by 0x4326E0: netlink_nexthop_change (rt_netlink.c:2433) | |||
==1478713== by 0x427320: netlink_parse_info (kernel_netlink.c:945) | |||
==1478713== by 0x432DAD: netlink_nexthop_read (rt_netlink.c:2488) | |||
==1478713== by 0x41B600: interface_list (if_netlink.c:1486) | |||
==1478713== by 0x457275: zebra_ns_enable (zebra_ns.c:127) | |||
Repro with: | |||
ip next add id 1 blackhole | |||
ip next add id 2 blackhole | |||
valgrind /usr/lib/frr/zebra | |||
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com> | |||
(cherry picked from commit c25c3ea57a3dcd3b36d86ba76dd34961bcb662f0) | |||
--- | |||
zebra/zebra_router.c | 7 ++++--- | |||
1 file changed, 4 insertions(+), 3 deletions(-) | |||
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c | |||
index a891ffb76a..ea2b6752b3 100644 | |||
--- a/zebra/zebra_router.c | |||
+++ b/zebra/zebra_router.c | |||
@@ -223,10 +223,11 @@ void zebra_router_terminate(void) | |||
zebra_vxlan_disable(); | |||
zebra_mlag_terminate(); | |||
- hash_clean(zrouter.nhgs, zebra_nhg_hash_free); | |||
- hash_free(zrouter.nhgs); | |||
- hash_clean(zrouter.nhgs_id, NULL); | |||
+ /* Free NHE in ID table only since it has unhashable entries as well */ | |||
+ hash_clean(zrouter.nhgs_id, zebra_nhg_hash_free); | |||
hash_free(zrouter.nhgs_id); | |||
+ hash_clean(zrouter.nhgs, NULL); | |||
+ hash_free(zrouter.nhgs); | |||
hash_clean(zrouter.rules_hash, zebra_pbr_rules_free); | |||
hash_free(zrouter.rules_hash); |
@ -1,83 +0,0 @@ | |||
From 21d5b651bbc4bcad3656a1804692c70e32797c69 Mon Sep 17 00:00:00 2001 | |||
From: David Lamparter <equinox@diac24.net> | |||
Date: Thu, 2 Apr 2020 21:16:04 +0200 | |||
Subject: [PATCH] bgpd, ospfd, ospf6d: long is not bool :( | |||
... Oops ... | |||
(for context, the defaults code originally didn't have a dedicated | |||
"bool" variant and just used long for bools... I derp'd this when | |||
adding bool as a separate case :( ) | |||
Reported-by: Donald Sharp <sharpd@cumulusnetworks.com> | |||
Signed-off-by: David Lamparter <equinox@diac24.net> | |||
(cherry picked from commit 4c1458b595282bff6a6e0b20767bb5cb655d0b4c) | |||
--- | |||
bgpd/bgp_vty.c | 16 ++++++++-------- | |||
ospf6d/ospf6_top.c | 4 ++-- | |||
ospfd/ospf_vty.c | 4 ++-- | |||
3 files changed, 12 insertions(+), 12 deletions(-) | |||
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c | |||
index 243822206c..4f5ba285aa 100644 | |||
--- a/bgpd/bgp_vty.c | |||
+++ b/bgpd/bgp_vty.c | |||
@@ -73,20 +73,20 @@ | |||
#endif | |||
FRR_CFG_DEFAULT_BOOL(BGP_IMPORT_CHECK, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
FRR_CFG_DEFAULT_BOOL(BGP_SHOW_HOSTNAME, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
FRR_CFG_DEFAULT_BOOL(BGP_LOG_NEIGHBOR_CHANGES, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
FRR_CFG_DEFAULT_BOOL(BGP_DETERMINISTIC_MED, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
FRR_CFG_DEFAULT_ULONG(BGP_CONNECT_RETRY, | |||
{ .val_ulong = 10, .match_profile = "datacenter", }, | |||
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c | |||
index 95537eb86e..ba3c1b8907 100644 | |||
--- a/ospf6d/ospf6_top.c | |||
+++ b/ospf6d/ospf6_top.c | |||
@@ -52,8 +52,8 @@ | |||
DEFINE_QOBJ_TYPE(ospf6) | |||
FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
/* global ospf6d variable */ | |||
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c | |||
index 152a7e83b7..92c9191801 100644 | |||
--- a/ospfd/ospf_vty.c | |||
+++ b/ospfd/ospf_vty.c | |||
@@ -54,8 +54,8 @@ | |||
#include "ospfd/ospf_bfd.h" | |||
FRR_CFG_DEFAULT_BOOL(OSPF_LOG_ADJACENCY_CHANGES, | |||
- { .val_long = true, .match_profile = "datacenter", }, | |||
- { .val_long = false }, | |||
+ { .val_bool = true, .match_profile = "datacenter", }, | |||
+ { .val_bool = false }, | |||
) | |||
static const char *const ospf_network_type_str[] = { |