netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
[platform/kernel/linux-rpi.git] / net / netfilter / nft_dynset.c
index 9af4f93..4990f7c 100644 (file)
@@ -123,7 +123,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
                u32 flags = ntohl(nla_get_be32(tb[NFTA_DYNSET_FLAGS]));
 
                if (flags & ~NFT_DYNSET_F_INV)
-                       return -EINVAL;
+                       return -EOPNOTSUPP;
                if (flags & NFT_DYNSET_F_INV)
                        priv->invert = true;
        }
@@ -156,7 +156,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
        timeout = 0;
        if (tb[NFTA_DYNSET_TIMEOUT] != NULL) {
                if (!(set->flags & NFT_SET_TIMEOUT))
-                       return -EINVAL;
+                       return -EOPNOTSUPP;
 
                err = nf_msecs_to_jiffies64(tb[NFTA_DYNSET_TIMEOUT], &timeout);
                if (err)
@@ -170,7 +170,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
 
        if (tb[NFTA_DYNSET_SREG_DATA] != NULL) {
                if (!(set->flags & NFT_SET_MAP))
-                       return -EINVAL;
+                       return -EOPNOTSUPP;
                if (set->dtype == NFT_DATA_VERDICT)
                        return -EOPNOTSUPP;