]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zebra_dplane.c
zebra: Remove `struct nlsock` from dataplane information and use `int fd`
authorDonald Sharp <sharpd@nvidia.com>
Wed, 2 Feb 2022 18:21:52 +0000 (13:21 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 8 Feb 2022 22:28:19 +0000 (17:28 -0500)
commitd4000d7ba3242c0e6adfa56544a34312b0f566a9
tree3b21518ad9af9373fb2de44b0e40d507e6c436b3
parent3670f5047cb00865c15b2f3ebdfcfe634443db61
zebra: Remove `struct nlsock` from dataplane information and use `int fd`

Store the fd that corresponds to the appropriate `struct nlsock` and pass
that around in the dplane context instead of the pointer to the nlsock.
Modify the kernel_netlink.c code to store in a hash the `struct nlsock`
with the socket fd as the key.

Why do this?  The dataplane context is used to pass around the `struct nlsock`
but the zebra code has a bug where the received buffer for kernel netlink
messages from the kernel is not big enough.  So we need to dynamically
grow the receive buffer per socket, instead of having a non-dynamic buffer
that we read into.  By passing around the fd we can look up the `struct nlsock`
that will soon have the associated buffer and not have to worry about `const`
issues that will arise.

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