]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2696 from sworleys/Netlink-Fuzz
authorRuss White <russ@riw.us>
Sun, 29 Jul 2018 12:33:43 +0000 (08:33 -0400)
committerGitHub <noreply@github.com>
Sun, 29 Jul 2018 12:33:43 +0000 (08:33 -0400)
zebra: Add code for fuzzing netlink

1  2 
configure.ac
zebra/kernel_netlink.c

diff --cc configure.ac
Simple merge
index cd881dcc244d5cb9fa85eb4819468945a1b1c5a2,bc2ed7f8f4af26f929be5548c2eb1654a9d09728..c627bda4f7c34f5fb2135c1b71629014f3dcaf67
@@@ -636,9 -727,17 +727,17 @@@ int netlink_parse_info(int (*filter)(st
                        zlog_hexdump(buf, status);
                }
  
+ #if defined(HANDLE_NETLINK_FUZZING)
+               if (!netlink_read) {
+                       zlog_debug("Writing incoming netlink message");
+                       netlink_write_incoming(buf, status,
+                                              netlink_file_counter++);
+               }
+ #endif /* HANDLE_NETLINK_FUZZING */
                read_in++;
                for (h = (struct nlmsghdr *)buf;
 -                   NLMSG_OK(h, (unsigned int)status);
 +                   (status >= 0 && NLMSG_OK(h, (unsigned int)status));
                     h = NLMSG_NEXT(h, status)) {
                        /* Finish of reading. */
                        if (h->nlmsg_type == NLMSG_DONE)