From: Ben Pfaff <blp@nicira.com>
Date: Thu, 20 May 2010 22:53:17 +0000 (-0700)
Subject: netlink: Fix bad assumption about nested Netlink attributes.
X-Git-Tag: v1.1.0pre1~270
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b4d73e97bae62b5eb18bcd216b603b69ce63297b;p=sliver-openvswitch.git

netlink: Fix bad assumption about nested Netlink attributes.

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.
---

diff --git a/lib/netlink.c b/lib/netlink.c
index 5f26feb49..de88a81ed 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -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