From: John Crispin <john@phrozen.org>
To: Henry Yen <henry.yen@mediatek.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
"David S. Miller" <davem@davemloft.net>
Cc: Ryder Lee <ryder.lee@mediatek.com>,
netdev@vger.kernel.org, Sean Wang <sean.wang@kernel.org>,
Weijie Gao <weijie.gao@mediatek.com>,
linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] netfilter: fix checking method of conntrack helper
Date: Mon, 14 Jan 2019 11:36:57 +0100 [thread overview]
Message-ID: <ac699d64-cb0d-8cf2-99cb-54d6da52d6a8@phrozen.org> (raw)
In-Reply-To: <1547459983-15724-1-git-send-email-henry.yen@mediatek.com>
On 14/01/2019 10:59, Henry Yen wrote:
> This patch uses nfct_help() to detect whether an
> established connection needs conntrack helper instead of using
> test_bit(IPS_HELPER_BIT, &ct->status).
>
> The reason is that IPS_HELPER_BIT is only set when using explicit
> CT target.
>
> However, in the case that a device enables conntrack helper via
> command "echo 1 > /proc/sys/net/netfilter/nf_conntrack_helper",
> the status of IPS_HELPER_BIT will not present any change, and
> consequently it loses the checking ability in the context.
>
> Signed-off-by: Henry Yen <henry.yen@mediatek.com>
> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Tested-by: John Crispin <john@phrozen.org>
> ---
> net/netfilter/nft_flow_offload.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
> index 974525eb92df..de4684cc4633 100644
> --- a/net/netfilter/nft_flow_offload.c
> +++ b/net/netfilter/nft_flow_offload.c
> @@ -12,6 +12,7 @@
> #include <net/netfilter/nf_conntrack_core.h>
> #include <linux/netfilter/nf_conntrack_common.h>
> #include <net/netfilter/nf_flow_table.h>
> +#include <net/netfilter/nf_conntrack_helper.h>
>
> struct nft_flow_offload {
> struct nft_flowtable *flowtable;
> @@ -71,6 +72,7 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
> struct flow_offload *flow;
> enum ip_conntrack_dir dir;
> struct nf_conn *ct;
> + const struct nf_conn_help *help;
> int ret;
>
> if (nft_flow_offload_skip(pkt->skb))
> @@ -88,7 +90,8 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
> goto out;
> }
>
> - if (test_bit(IPS_HELPER_BIT, &ct->status))
> + help = nfct_help(ct);
> + if (help)
> goto out;
>
> if (ctinfo == IP_CT_NEW ||
prev parent reply other threads:[~2019-01-14 10:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-14 9:59 [PATCH] netfilter: fix checking method of conntrack helper Henry Yen
2019-01-14 10:36 ` John Crispin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac699d64-cb0d-8cf2-99cb-54d6da52d6a8@phrozen.org \
--to=john@phrozen.org \
--cc=davem@davemloft.net \
--cc=henry.yen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@kernel.org \
--cc=weijie.gao@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).