Skip to content

Commit

Permalink
zebra: Move v6_rr_semantics to be part of zrouter structure
Browse files Browse the repository at this point in the history
Move global variable v6_rr_semantics from a global data structure
into the zrouter data structure.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Nov 3, 2023
1 parent 4bfd054 commit f2443d3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions zebra/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ int retain_mode = 0;

int graceful_restart;

bool v6_rr_semantics = false;

/* Receive buffer size for kernel control sockets */
#define RCVBUFSIZE_MIN 4194304
#ifdef HAVE_NETLINK
Expand Down Expand Up @@ -385,7 +383,7 @@ int main(int argc, char **argv)
vrf_configure_backend(VRF_BACKEND_NETNS);
break;
case OPTION_V6_RR_SEMANTICS:
v6_rr_semantics = true;
zrouter.v6_rr_semantics = true;
break;
case OPTION_ASIC_OFFLOAD:
if (!strcmp(optarg, "notify_on_offload"))
Expand Down
2 changes: 0 additions & 2 deletions zebra/rib.h
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,6 @@ extern void zebra_vty_init(void);

extern pid_t pid;

extern bool v6_rr_semantics;

extern uint32_t rt_table_main_id;

/* Name of hook calls */
Expand Down
5 changes: 2 additions & 3 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ 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) || v6_rr_semantics)) ||
((p->family == AF_INET) || zrouter.v6_rr_semantics)) ||
force_rr)
req->n.nlmsg_flags |= NLM_F_REPLACE;

Expand Down Expand Up @@ -3095,8 +3095,7 @@ 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 || v6_rr_semantics) {
if (p->family == AF_INET || zrouter.v6_rr_semantics) {
/* Single 'replace' operation */

/*
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ struct zebra_router {
bool notify_on_ack;
bool v6_with_v4_nexthop;

bool v6_rr_semantics;

/*
* If the asic is notifying us about successful nexthop
* allocation/control. Some developers have made their
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -4048,7 +4048,7 @@ 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",
v6_rr_semantics ? "Replace" : "Delete than Add");
zrouter.v6_rr_semantics ? "Replace" : "Delete than Add");

#ifdef GNU_LINUX
if (!vrf_is_backend_netns())
Expand Down

0 comments on commit f2443d3

Please sign in to comment.