Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to set NETLINK_GET_STRICT_CHK socket option
Added in https://github.com/mdlayher/netlink/blob/main/CHANGELOG.md#v130 > the netlink.GetStrictCheck option can be used to tell the kernel to be more strict when parsing requests. This enables more safety checks and can allow the kernel to perform more advanced request filtering in subsystems such as route netlink. This connection option would allow netlink to get the kernel to filter out unnecessary info on dumping. This is important for us, as we have many systems that consume BGP and have in excess of 800k routes in non-default routing tables. Unfortunately, support for NETLINK_GET_STRICT_CHK was added in kernel 4.20, and mdlayher/netlink returns a syscall error when it is not supported. This patch attempts to set the option and handles the ENOPROTOOPT error if it does not succeed. Behavior should be unchanged on kernels that predate 4.20, and later kernels will see better netlink performance as the kernel returns less info per query of qdisc.
- Loading branch information