Message ID | 20210802134340.121458247@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4C64C00143 for <stable@archiver.kernel.org>; Mon, 2 Aug 2021 13:55:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2E6B61185 for <stable@archiver.kernel.org>; Mon, 2 Aug 2021 13:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbhHBNzk (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 2 Aug 2021 09:55:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235855AbhHBNya (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 2 Aug 2021 09:54:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91231610CC; Mon, 2 Aug 2021 13:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912376; bh=VZmg7G6FLytuAFScgXgIqOhNSdDYIumoebdYUvguD0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p53P0YOpeGL6gLlPp7FlRguknqQB39ljt8Y0d1l4mxlT3yrKCiQAgSMXHTbObzYDR yWRhPH2T9WQyhPRNH0Ra1np+KYaXS5GHtGIieGIMJC40lKHo0LzRq8Ihh0ZUZFUrTM v4T+ZsTNid61bhKPXGNczFiXFP9LlJpBqEA6NbyA= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 5.10 32/67] netfilter: nft_nat: allow to specify layer 4 protocol NAT only Date: Mon, 2 Aug 2021 15:44:55 +0200 Message-Id: <20210802134340.121458247@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134339.023067817@linuxfoundation.org> References: <20210802134339.023067817@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index 4bcf33b049c4..ea53fd999f46 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c @@ -201,7 +201,9 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr, alen = sizeof_field(struct nf_nat_range, min_addr.ip6); break; default: - return -EAFNOSUPPORT; + if (tb[NFTA_NAT_REG_ADDR_MIN]) + return -EAFNOSUPPORT; + break; } priv->family = family;