frr_preinit(&ospfd_di, argc, argv);
-
#ifdef FUZZING
- ospf_master_init(frr_init_fast());
- ospf_debug_init();
- ospf_vrf_init();
+ /* INIT */
+ {
+ ospf_master_init(frr_init_fast());
+ ospf_debug_init();
+ ospf_vrf_init();
+ access_list_init();
+ prefix_list_init();
+ ospf_if_init();
+ ospf_zebra_init(master, instance);
+ ospf_bfd_init();
+ ospf_route_map_init();
+ ospf_opaque_init();
+ ospf_error_init();
+ }
- access_list_init();
- prefix_list_init();
+ struct prefix p;
+ struct interface *ifp = if_create_ifindex(69, 0);
+ ifp->mtu = 68;
+ str2prefix("11.0.2.0/24", &p);
- ospf_if_init();
+ bool created;
+ struct ospf *o = ospf_get_instance(instance, &created);
- ospf_vty_init();
- ospf_vty_show_init();
- ospf_vty_clear_init();
+ struct in_addr in;
+ inet_pton(AF_INET, "0.0.0.0", &in);
+ struct ospf_area *a = ospf_area_new(o, in);
- ospf_route_map_init();
- ospf_opaque_init();
+ struct connected *c = connected_add_by_prefix(ifp, &p, NULL);
+ add_ospf_interface(c, a);
- ospf_error_init();
+ struct ospf_interface *oi = listhead(a->oiflist)->data;
+ if (!oi)
+ goto done;
+ oi->state = 7; // ISM_DR
- /* Fuzz here */
- bool created;
- struct ospf *o = ospf_get_instance(instance, &created);
+#ifdef __AFL_HAVE_MANUAL_CONTROL
+ __AFL_INIT();
+#endif
uint8_t *input;
int r = frrfuzz_read_input(&input);
goto done;
}
- struct prefix p;
- struct interface *ifp = if_create_ifindex(69, 0);
- ifp->mtu = 68;
- str2prefix("11.0.2.0/24", &p);
-
- struct in_addr in;
- inet_pton(AF_INET, "0.0.0.0", &in);
- struct ospf_area *a = ospf_area_new(o, in);
-
- struct connected *c = connected_add_by_prefix(ifp, &p, NULL);
- add_ospf_interface(c, a);
-
- struct ospf_interface *oi = listhead(a->oiflist)->data;
- if (!oi)
- goto done;
- oi->state = 7; // ISM_DR
-
- // struct ospf_interface *oi = ospf_if_new(o, ifp, &p);
- // oi->connected = c;
o->fuzzing_packet_ifp = ifp;