[ovs-dev] [PATCH 2/2] lib/netlink: Use correct netlink max message size

Ben Pfaff blp at ovn.org
Tue Oct 31 19:53:18 UTC 2017


On Fri, Sep 22, 2017 at 07:44:53AM -0700, Greg Rose wrote:
> The maximum message size for recent Linux kernels is 32Kb and in older
> kernels it is 16KB.
> 
> See http://www.spinics.net/lists/netdev/msg431592.html
> 
> Adjust the size checked and update a comment.
> 
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>

...

> diff --git a/lib/netlink.c b/lib/netlink.c
> index de3ebcd..04310ff 100644
> --- a/lib/netlink.c
> +++ b/lib/netlink.c
> @@ -570,7 +570,7 @@ nl_msg_next(struct ofpbuf *buffer, struct ofpbuf *msg)
>  bool
>  nl_attr_oversized(size_t payload_size)
>  {
> -    return payload_size > UINT16_MAX - NLA_HDRLEN;
> +    return payload_size > INT16_MAX - NLA_HDRLEN;
>  }

Thanks for the patch!

I am confused by a difference between the commit message and the code.
Before this patch, nl_attr_oversized() considered an attribute of about
64 kB to be oversize; after this patch, about 32 kB.  Shouldn't the new
value be about 16 kB?

Thanks,

Ben.


More information about the dev mailing list