summaryrefslogtreecommitdiff
path: root/zebra/main.c
diff options
context:
space:
mode:
authorMartin Pels <mpels@ripe.net>2023-08-22 13:27:59 +0200
committerMartin Pels <mpels@ripe.net>2023-08-22 15:29:07 +0200
commit4d96ce1b4d7f45aa3fc792d882040031548cd812 (patch)
tree56559ea9eccc54a47b724598f9829e2660330d75 /zebra/main.c
parent451fb24b17cb9272981d3809f755985d9ce52f79 (diff)
zebra: Make main routing table (RT_TABLE_MAIN) configurable
Signed-off-by: Martin Pels <mpels@ripe.net>
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/main.c b/zebra/main.c
index aeb9739c13..1e833ce7f1 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -69,6 +69,8 @@ uint32_t rcvbufsize = RCVBUFSIZE_MIN;
uint32_t rcvbufsize = 128 * 1024;
#endif
+uint32_t rt_table_main_id = RT_TABLE_MAIN;
+
#define OPTION_V6_RR_SEMANTICS 2000
#define OPTION_ASIC_OFFLOAD 2001
#define OPTION_V6_WITH_V4_NEXTHOP 2002
@@ -88,6 +90,7 @@ const struct option longopts[] = {
{ "nl-bufsize", required_argument, NULL, 's' },
{ "v6-rr-semantics", no_argument, NULL, OPTION_V6_RR_SEMANTICS },
#endif /* HAVE_NETLINK */
+ {"routing-table", optional_argument, NULL, 'R'},
{ 0 }
};
@@ -298,7 +301,7 @@ int main(int argc, char **argv)
frr_preinit(&zebra_di, argc, argv);
- frr_opt_add("baz:e:rK:s:"
+ frr_opt_add("baz:e:rK:s:R:"
#ifdef HAVE_NETLINK
"n"
#endif
@@ -319,6 +322,7 @@ int main(int argc, char **argv)
#else
" -s, Set kernel socket receive buffer size\n"
#endif /* HAVE_NETLINK */
+ " -R, --routing-table Set kernel routing table\n"
);
while (1) {
@@ -373,6 +377,9 @@ int main(int argc, char **argv)
"Rcvbufsize is smaller than recommended value: %d\n",
RCVBUFSIZE_MIN);
break;
+ case 'R':
+ rt_table_main_id = atoi(optarg);
+ break;
#ifdef HAVE_NETLINK
case 'n':
vrf_configure_backend(VRF_BACKEND_NETNS);