From 81a2f870dda76dd2fca64fea159ba05e41981d7f Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Thu, 19 Jul 2018 15:21:29 -0400 Subject: zebra: Add code for fuzzing netlink This code allows you to fuzz the netlink listening socket in zebra by --enable-fuzzing and passing the -w [FILE] option when running zebra. File collection is stored in /var/run/frr/netlink_* where each number is just a counter to keep the files distinct. Signed-off-by: Stephen Worley --- zebra/kernel_netlink.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zebra/kernel_netlink.h') diff --git a/zebra/kernel_netlink.h b/zebra/kernel_netlink.h index 80bb876e0b..78bfdfa178 100644 --- a/zebra/kernel_netlink.h +++ b/zebra/kernel_netlink.h @@ -45,6 +45,10 @@ extern const char *nl_rtproto_to_str(uint8_t rtproto); extern const char *nl_family_to_str(uint8_t family); extern const char *nl_rttype_to_str(uint8_t rttype); +#if defined(HANDLE_ZAPI_FUZZING) +extern void set_netlink_read(int flag); +extern void netlink_read_init(const char *fname); +#endif extern int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int), struct nlsock *nl, struct zebra_ns *zns, int count, int startup); -- cgit v1.2.3