netlink: Fix bad assumption about nested Netlink attributes.
authorBen Pfaff <blp@nicira.com>
Thu, 20 May 2010 22:53:17 +0000 (15:53 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 17 Jun 2010 17:30:18 +0000 (10:30 -0700)
I had assumed that nested Netlink attributes contained an entire Netlink
message, including header.  This is wrong: they contain only a series of
attributes.

Nothing in the tree actually used nested attributes until now, so this
doesn't fix any existing bugs.

lib/netlink.c

index 5f26feb..de88a81 100644 (file)
@@ -772,7 +772,7 @@ static const size_t attr_len_range[][2] = {
     [NL_A_U64] = { 8, 8 },
     [NL_A_STRING] = { 1, SIZE_MAX },
     [NL_A_FLAG] = { 0, SIZE_MAX },
-    [NL_A_NESTED] = { NLMSG_HDRLEN, SIZE_MAX },
+    [NL_A_NESTED] = { 0, SIZE_MAX },
 };
 
 /* Parses the 'msg' starting at the given 'nla_offset' as a sequence of Netlink