]> git.proxmox.com Git - mirror_frr.git/commit - zebra/kernel_netlink.c
zebra: memset the `struct rtattr *tb[SIZE]` in setting function
authorDonald Sharp <sharpd@nvidia.com>
Wed, 5 May 2021 03:43:47 +0000 (23:43 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 12 May 2021 00:05:51 +0000 (20:05 -0400)
commit269b69d70336f8f831e761ce7231e4574477e6c0
tree899255516ccaa64cc5f8c73737d2016745420338
parent449e54fd12372273dcac68781eb77c1297aeb2ba
zebra: memset the `struct rtattr *tb[SIZE]` in setting function

In order to parse the netlink message into the
`struct rtattr *tb[size]` it is assumed that the buffer is
memset to 0 before the parsing.  As such if you attempt
to read a value that was not returned in the message
you will not crash when you test for it.

The code has places were we memset it and places where we don't.
This *will* lead to crashes when the kernel changes.  In
our parsing routines let's have them memset instead of having
to remember to do it pre pass in to the parser.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/if_netlink.c
zebra/kernel_netlink.c
zebra/rt_netlink.c