Re: [nft PATCH 2/4] mnl: Increase receive buffer in mnl_batch_talk()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <phil@xxxxxx>
> ---
>  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];

Right, this needs to be done.

I think I need to enhance my code to estimate the buffer size, through
number of commands and the average message size that is sent to the
kernel. This can be extracted from the batch.

>  	fd_set readfds;
>  	struct timeval tv = {
>  		.tv_sec		= 0,
> -- 
> 2.21.0
> 



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux