On Wed, May 29, 2019 at 03:13:44PM +0200, Phil Sutter wrote:
> Be prepared to receive larger messages for the same reason as in
> nft_mnl_recv() and mnl_nft_event_listener().
> 
> Signed-off-by: Phil Sutter <p...@nwl.cc>
> ---
>  src/mnl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mnl.c b/src/mnl.c
> index 2c5a26a5e3465..06280aa2cb50a 100644
> --- a/src/mnl.c
> +++ b/src/mnl.c
> @@ -287,7 +287,7 @@ int mnl_batch_talk(struct netlink_ctx *ctx, struct 
> list_head *err_list)
>  {
>       struct mnl_socket *nl = ctx->nft->nf_sock;
>       int ret, fd = mnl_socket_get_fd(nl), portid = mnl_socket_get_portid(nl);
> -     char rcv_buf[MNL_SOCKET_BUFFER_SIZE];
> +     char rcv_buf[NFT_NLMSG_MAXSIZE];

Revisiting this:

The kernel uses NLMSG_GOODSIZE for events and also for the echo
message, so MNL_SOCKET_BUFFER_SIZE should be fine.

Reply via email to