summaryrefslogtreecommitdiff
path: root/zebra/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/zebra/main.c b/zebra/main.c
index cf677a7753..36c931c4ee 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -201,6 +201,9 @@ int main(int argc, char **argv)
char *lblmgr_path = NULL;
struct sockaddr_storage dummy;
socklen_t dummylen;
+#if defined(HANDLE_ZAPI_FUZZING)
+ char *fuzzing = NULL;
+#endif
frr_preinit(&zebra_di, argc, argv);
@@ -209,6 +212,9 @@ int main(int argc, char **argv)
#ifdef HAVE_NETLINK
"s:"
#endif
+#if defined(HANDLE_ZAPI_FUZZING)
+ "c:"
+#endif
,
longopts,
" -b, --batch Runs in batch mode\n"
@@ -221,6 +227,9 @@ int main(int argc, char **argv)
#ifdef HAVE_NETLINK
" -s, --nl-bufsize Set netlink receive buffer size\n"
#endif /* HAVE_NETLINK */
+#if defined(HANDLE_ZAPI_FUZZING)
+ " -c <file> Bypass normal startup use this file for tetsting of zapi"
+#endif
);
while (1) {
@@ -271,6 +280,11 @@ int main(int argc, char **argv)
nl_rcvbufsize = atoi(optarg);
break;
#endif /* HAVE_NETLINK */
+#if defined(HANDLE_ZAPI_FUZZING)
+ case 'c':
+ fuzzing = optarg;
+ break;
+#endif
default:
frr_help_exit(1);
break;
@@ -308,6 +322,13 @@ int main(int argc, char **argv)
* routing socket. */
zebra_ns_init();
+#if defined(HANDLE_ZAPI_FUZZING)
+ if (fuzzing) {
+ zserv_read_file(fuzzing);
+ exit(0);
+ }
+#endif
+
/* Process the configuration file. Among other configuration
* directives we can meet those installing static routes. Such
* requests will not be executed immediately, but queued in