netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables-nftables 1/2] xtables: fix missing ipt_entry for MASQUERADE target
Date: Tue, 8 Oct 2013 11:44:52 +0200	[thread overview]
Message-ID: <20131008094452.GB7186@localhost> (raw)
In-Reply-To: <5253CD59.9060508@linux.intel.com>

On Tue, Oct 08, 2013 at 12:16:09PM +0300, Tomasz Bursztyka wrote:
> Hi Pablo,
> >+	/* Default on AF_INET */
> >+	h->ops = nft_family_ops_lookup(AF_INET);
> >+	if (h->ops == NULL)
> >+		xtables_error(PARAMETER_PROBLEM, "Unknown family");
> >+
> 
> Since you use AF_INET by default...

If neither -4 and -6 is passed, we assume AF_INET.

> >  	opts = xt_params->orig_opts;
> >  	while ((cs.c = getopt_long(argc, argv,
> >  	   "-:A:C:D:R:I:L::S::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:i:fbvnt:m:xc:g:46",
> >@@ -894,6 +899,9 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table)
> >  			if (args.proto == 0 && (args.invflags & XT_INV_PROTO))
> >  				xtables_error(PARAMETER_PROBLEM,
> >  					   "rule would never match protocol");
> >+
> >+			/* This needs to happen here to parse extensions */
> >+			h->ops->proto_parse(&cs, &args);
> >  			break;
> >  		case 's':
> >@@ -1033,11 +1041,21 @@ int do_commandx(struct nft_handle *h, int argc, char *argv[], char **table)
> >  		case '4':
> >  			if (args.family != AF_INET)
> >  				exit_tryhelp(2);
> >+
> >+			h->ops = nft_family_ops_lookup(args.family);
> >+			if (h->ops == NULL)
> >+				xtables_error(PARAMETER_PROBLEM,
> >+					      "Unknown family");
> 
> ... this is useless I guess, then.

Yes, copied and pasted from the original code, will remove it.

      reply	other threads:[~2013-10-08  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08  9:11 [iptables-nftables 1/2] xtables: fix missing ipt_entry for MASQUERADE target Pablo Neira Ayuso
2013-10-08  9:11 ` [iptables-nftables 2/2] nft: pass ipt_entry to ->save_firewall hook Pablo Neira Ayuso
2013-10-08  9:16 ` [iptables-nftables 1/2] xtables: fix missing ipt_entry for MASQUERADE target Tomasz Bursztyka
2013-10-08  9:44   ` Pablo Neira Ayuso [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=20131008094452.GB7186@localhost \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=tomasz.bursztyka@linux.intel.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).