On 10/31/2017 12:53 PM, Ben Pfaff wrote:
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 <gvrose8...@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.


IIRC this is in user space so we prepare for whatever the maximum size we might
get from a kernel, which is 32KB.

We could have just left it at 64KB but we don't ever need that much.

- Greg
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to