static struct ospf *FuzzingCreateOspf(void)
{
struct prefix p;
- struct interface *ifp = if_create_ifindex(69, 0);
+ struct interface *ifp = if_create_ifindex(69, 0, NULL);
ifp->mtu = 68;
str2prefix("11.0.2.0/24", &p);
struct interface *ifp;
struct prefix p;
- ifp = if_create_ifindex(69, 0);
+ ifp = if_create_ifindex(69, 0, NULL);
ifp->mtu = 68;
str2prefix("11.0.2.1/24", &p);
connected_add_by_prefix(ifp, &p, NULL);
static struct zserv *FuzzingZc;
#endif /* FUZZING_LIBFUZZER */
+static struct stream_fifo *fifo;
+
static bool FuzzingInitialized;
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
if (!FuzzingInitialized) {
FuzzingInit();
FuzzingInitialized = true;
+ fifo = stream_fifo_new();
}
/*
struct stream *s = stream_new(size + 1);
stream_put(s, data, size);
+ stream_fifo_push(fifo, s);
- zserv_handle_commands(zc, s);
-
- stream_free(s);
+ zserv_handle_commands(zc, fifo);
done:
zserv_close_client(zc);
STREAM_GETL(s, size);
STREAM_GETL(s, base);
+#ifndef FUZZING
assert(proto == client->proto && instance == client->instance);
+#endif
/* call hook to get a chunk using wrapper */
lm_get_chunk_call(&lmc, client, keep, size, base, vrf_id);
STREAM_GETL(s, start);
STREAM_GETL(s, end);
+#ifndef FUZZING
assert(proto == client->proto && instance == client->instance);
+#endif
/* call hook to release a chunk using wrapper */
lm_release_chunk_call(client, start, end);