]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: enable deferred forkserver mode
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 2 Jan 2020 07:02:31 +0000 (02:02 -0500)
committerQuentin Young <qlyoung@nvidia.com>
Mon, 15 Nov 2021 19:52:41 +0000 (14:52 -0500)
Having narrowed down the issue with deferred mode to capability privs,
and having disabled those, we can now use afl deferred mode for...10x
performance gainz?!?!? zomg!

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_main.c

index 26c22c09793443b215fd13d534df48c20a97ed39..39b1b5591bcfe5a450bfa623277e3ae999052b86 100644 (file)
@@ -426,17 +426,17 @@ int main(int argc, char **argv)
        /* Initialize basic BGP datastructures */
        bgp_master_init(frr_init_fast(), buffer_size);
        bm->port = bgp_port;
-       if (bgp_port == 0)
-               bgp_option_set(BGP_OPT_NO_LISTEN);
+       bgp_option_set(BGP_OPT_NO_LISTEN);
        bm->address = bgp_address;
-       if (no_fib_flag || no_zebra_flag)
-               bgp_option_set(BGP_OPT_NO_FIB);
-       if (no_zebra_flag)
-               bgp_option_set(BGP_OPT_NO_ZEBRA);
+
+
+       bgp_option_set(BGP_OPT_NO_FIB);
+       bgp_option_set(BGP_OPT_NO_ZEBRA);
        bgp_error_init();
        // bgp_vrf_init();
        bgp_init((unsigned short)instance);
 
+
        /* Create a default instance and peer */
        struct bgp *b;
        as_t as = 65001;
@@ -461,6 +461,10 @@ int main(int argc, char **argv)
                SET_FLAG(p->af_cap[afi][safi], 0x3FFF);
        }
 
+#ifdef __AFL_HAVE_MANUAL_CONTROL
+       __AFL_INIT();
+#endif
+
 
        uint8_t *input;
        int r = frrfuzz_read_input(&input);