diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-02-02 19:21:52 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-08 23:28:19 +0100 |
commit | d4000d7ba3242c0e6adfa56544a34312b0f566a9 (patch) | |
tree | 3b21518ad9af9373fb2de44b0e40d507e6c436b3 /zebra/kernel_netlink.h | |
parent | zebra: Store the sequence number to use as part of the dp_info (diff) | |
download | frr-d4000d7ba3242c0e6adfa56544a34312b0f566a9.tar.xz frr-d4000d7ba3242c0e6adfa56544a34312b0f566a9.zip |
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>
Diffstat (limited to 'zebra/kernel_netlink.h')
-rw-r--r-- | zebra/kernel_netlink.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/kernel_netlink.h b/zebra/kernel_netlink.h index cf8b8c785..ae88f3372 100644 --- a/zebra/kernel_netlink.h +++ b/zebra/kernel_netlink.h @@ -146,6 +146,7 @@ extern int netlink_config_write_helper(struct vty *vty); extern void netlink_set_batch_buffer_size(uint32_t size, uint32_t threshold, bool set); +extern struct nlsock *kernel_netlink_nlsock_lookup(int sock); #endif /* HAVE_NETLINK */ #ifdef __cplusplus |