netlink: remove NLA_NESTED_COMPAT
authorJohannes Berg <johannes.berg@intel.com>
Wed, 26 Sep 2018 09:15:30 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Sep 2018 17:24:39 +0000 (10:24 -0700)
This isn't used anywhere, so we might as well get rid of it.

Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netlink.h
lib/nlattr.c

index 318b1ded3833392a9b4ca8f6f997a9db8f70a1f1..b680fe365e9125e5dd13eabcee475268ffbeed9c 100644 (file)
@@ -172,7 +172,6 @@ enum {
        NLA_FLAG,
        NLA_MSECS,
        NLA_NESTED,
-       NLA_NESTED_COMPAT,
        NLA_NUL_STRING,
        NLA_BINARY,
        NLA_S8,
@@ -203,7 +202,6 @@ enum {
  *    NLA_BINARY           Maximum 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_S8, NLA_S16,
index bb6fe5ed4ecf5682716d04181afc9a7c6a7f9b30..120ad569e13da7bf21063d464cc993c2365c1b32 100644 (file)
@@ -140,17 +140,6 @@ static int validate_nla(const struct nlattr *nla, int maxtype,
                        return -ERANGE;
                break;
 
-       case NLA_NESTED_COMPAT:
-               if (attrlen < pt->len)
-                       return -ERANGE;
-               if (attrlen < NLA_ALIGN(pt->len))
-                       break;
-               if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN)
-                       return -ERANGE;
-               nla = nla_data(nla) + NLA_ALIGN(pt->len);
-               if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla))
-                       return -ERANGE;
-               break;
        case NLA_NESTED:
                /* a nested attributes is allowed to be empty; if its not,
                 * it must have a size of at least NLA_HDRLEN.