[ovs-dev] [QoS v2 09/17] netlink: Fix bad assumption about nested Netlink attributes.

Ben Pfaff blp at nicira.com
Tue Jun 8 20:41:29 UTC 2010


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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/netlink.c b/lib/netlink.c
index 68e027e..7be9a8d 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
-- 
1.7.1





More information about the dev mailing list