All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: gfree.wind@foxmail.com
Cc: netfilter-devel@vger.kernel.org, Gao Feng <fgao@ikuai8.com>
Subject: Re: [PATCH nf v5 2/3] netfilter: nat_helper: Make sure every proto nat module uses its nat_helper
Date: Fri, 14 Apr 2017 02:11:07 +0200	[thread overview]
Message-ID: <20170414001107.GA28754@salvia> (raw)
In-Reply-To: <74aaa9aaa69d65fa46d56faf5c4de671abf4a5cf.1490955730.git.fgao@ikuai8.com>

On Fri, Mar 31, 2017 at 06:38:20PM +0800, gfree.wind@foxmail.com wrote:
> +static struct nf_ct_nat_helper pptp_nat = {
> +	.name			= "pptp_nat",

Why all these with "xyz_nat" names?

This is going to break ctnetlink, as this is the name that identifies
the NAT helper to be used.

> +	.expectfn		= pptp_expectfn,
> +};
> +
>  static void pptp_expectfn(struct nf_conn *ct,
>  			 struct nf_conntrack_expect *exp)
>  {
> @@ -221,7 +229,7 @@ static int exp_gre(struct nf_conn *ct, __be16 callid, __be16 peer_callid)
>  			  &ct->tuplehash[dir].tuple.src.u3,
>  			  &ct->tuplehash[dir].tuple.dst.u3,
>  			  IPPROTO_GRE, &peer_callid, &callid);
> -	exp_orig->expectfn = pptp_expectfn;
> +	exp_orig->nat_helper = &pptp_nat;
>  
>  	/* reply direction, PAC->PNS */
>  	dir = IP_CT_DIR_REPLY;
> @@ -230,7 +238,7 @@ static int exp_gre(struct nf_conn *ct, __be16 callid, __be16 peer_callid)
>  			  &ct->tuplehash[dir].tuple.src.u3,
>  			  &ct->tuplehash[dir].tuple.dst.u3,
>  			  IPPROTO_GRE, &callid, &peer_callid);
> -	exp_reply->expectfn = pptp_expectfn;
> +	exp_reply->nat_helper = &pptp_nat;

Why do we need to attach nat_helper instead of expectfn? I would
prefer we do not.

  reply	other threads:[~2017-04-14  0:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 10:38 [PATCH nf v5 0/3] Refine the robust of helper expectfn gfree.wind
2017-03-31 10:38 ` [PATCH nf v5 1/3] netfilter: helper: Rename struct nf_ct_helper_expectfn to nf_ct_nat_helper gfree.wind
2017-03-31 10:38 ` [PATCH nf v5 2/3] netfilter: nat_helper: Make sure every proto nat module uses its nat_helper gfree.wind
2017-04-14  0:11   ` Pablo Neira Ayuso [this message]
2017-04-14  0:46     ` Gao Feng
2017-04-14  1:02       ` Pablo Neira Ayuso
2017-04-17  0:50         ` Gao Feng
2017-03-31 10:38 ` [PATCH nf v5 3/3] netfilter: nat_helper: Remove the expectations when its module is unloaded gfree.wind

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=20170414001107.GA28754@salvia \
    --to=pablo@netfilter.org \
    --cc=fgao@ikuai8.com \
    --cc=gfree.wind@foxmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.