From 1a89d2034e0d2556a87793089b98dcf721687053 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 2 Jan 2020 02:02:31 -0500 Subject: [PATCH] bgpd: enable deferred forkserver mode 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 --- bgpd/bgp_main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 26c22c0979..39b1b5591b 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -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); -- 2.39.5