summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-11-06 14:56:50 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-11-06 14:56:50 +0100
commit7e1b56ba98c22bb26cd798b289a214abfb32a8e2 (patch)
treebe3a9db0cc4e78f15f97178ca84c2cb91342b422 /zebra
parentzebra: Move v6_rr_semantics to be part of zrouter structure (diff)
downloadfrr-7e1b56ba98c22bb26cd798b289a214abfb32a8e2.tar.xz
frr-7e1b56ba98c22bb26cd798b289a214abfb32a8e2.zip
zebra: When using Nexthop groups, use v6 RR semantics
The nexthop group route replace operation was made consistent across all versions of the kernel. A v6 route replacement does not need to do a delete than add when using nexthop groups Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/rt_netlink.c6
-rw-r--r--zebra/zebra_vty.c14
2 files changed, 17 insertions, 3 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 3351b0395..58116c656 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2209,7 +2209,8 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx
req->n.nlmsg_flags = NLM_F_CREATE | NLM_F_REQUEST;
if (((cmd == RTM_NEWROUTE) &&
- ((p->family == AF_INET) || zrouter.v6_rr_semantics)) ||
+ ((p->family == AF_INET) || kernel_nexthops_supported() ||
+ zrouter.v6_rr_semantics)) ||
force_rr)
req->n.nlmsg_flags |= NLM_F_REPLACE;
@@ -3095,7 +3096,8 @@ netlink_put_route_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx)
} else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_INSTALL) {
cmd = RTM_NEWROUTE;
} else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_UPDATE) {
- if (p->family == AF_INET || zrouter.v6_rr_semantics) {
+ if (p->family == AF_INET || kernel_nexthops_supported() ||
+ zrouter.v6_rr_semantics) {
/* Single 'replace' operation */
/*
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index fce358f9f..8c9724873 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -4028,6 +4028,17 @@ static int config_write_protocol(struct vty *vty)
return 1;
}
+static inline bool zebra_vty_v6_rr_semantics_used(void)
+{
+ if (zebra_nhg_kernel_nexthops_enabled())
+ return true;
+
+ if (zrouter.v6_rr_semantics)
+ return true;
+
+ return false;
+}
+
DEFUN (show_zebra,
show_zebra_cmd,
"show zebra",
@@ -4048,7 +4059,8 @@ DEFUN (show_zebra,
ttable_add_row(table, "EVPN|%s", is_evpn_enabled() ? "On" : "Off");
ttable_add_row(table, "Kernel socket buffer size|%d", rcvbufsize);
ttable_add_row(table, "v6 Route Replace Semantics|%s",
- zrouter.v6_rr_semantics ? "Replace" : "Delete then Add");
+ zebra_vty_v6_rr_semantics_used() ? "Replace"
+ : "Delete then Add");
#ifdef GNU_LINUX
if (!vrf_is_backend_netns())