diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-11-03 00:10:05 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-04 17:48:23 -0400 |
commit | 4b6cc7284ddc9a54910f111085ebf0143ef3f5bd (patch) | |
tree | d2c94d708bed468a0a2843f4d0611435b134306b | |
parent | c30bc94758ae2a38a5eb31767c1985c0aae0950b (diff) | |
download | op-kernel-dev-4b6cc7284ddc9a54910f111085ebf0143ef3f5bd.zip op-kernel-dev-4b6cc7284ddc9a54910f111085ebf0143ef3f5bd.tar.gz |
netlink: clarify attribute length check documentation
The documentation for how the length of attributes
is checked is wrong ("Exact length" isn't true, the
policy checks are for "minimum length") and a bit
misleading. Make it more complete and explain what
really happens.
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netlink.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h index 98c1854..cb1f350 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -192,8 +192,15 @@ enum { * NLA_NUL_STRING Maximum length of string (excluding NUL) * NLA_FLAG Unused * NLA_BINARY Maximum length of attribute payload - * NLA_NESTED_COMPAT Exact length of structure payload - * All other Exact length of attribute payload + * NLA_NESTED Don't use `len' field -- length verification is + * done by checking len of nested header (or empty) + * NLA_NESTED_COMPAT Minimum length of structure payload + * NLA_U8, NLA_U16, + * NLA_U32, NLA_U64, + * NLA_MSECS Leaving the length field zero will verify the + * given type fits, using it verifies minimum length + * just like "All other" + * All other Minimum length of attribute payload * * Example: * static const struct nla_policy my_policy[ATTR_MAX+1] = { |