netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Leblond <eric@regit.org>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, Eric Leblond <eric@regit.org>
Subject: [nftables PATCH 1/4] nat: add mandatory family attribute
Date: Mon, 16 Sep 2013 18:27:35 +0200	[thread overview]
Message-ID: <1379348858-29187-2-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1379348858-29187-1-git-send-email-eric@regit.org>

NFT_EXPR_NAT_FAMILY is a mandatory attribute for NAT rules and
it was not set by nftables.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 src/netlink_linearize.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 427fdb6..72c59e5 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -572,10 +572,14 @@ static void netlink_gen_nat_stmt(struct netlink_linearize_ctx *ctx,
 	enum nft_registers amin_reg, amax_reg;
 	enum nft_registers pmin_reg, pmax_reg;
 	int registers = 0;
+	int family;
 
 	nle = alloc_nft_expr("nat");
 	nft_rule_expr_set_u32(nle, NFT_EXPR_NAT_TYPE, stmt->nat.type);
 
+	family = nft_rule_attr_get_u32(ctx->nlr, NFT_RULE_ATTR_FAMILY);
+	nft_rule_expr_set_u32(nle, NFT_EXPR_NAT_FAMILY, family);
+
 	if (stmt->nat.addr) {
 		amin_reg = get_register(ctx);
 		registers++;
-- 
1.8.4.rc3


  reply	other threads:[~2013-09-16 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 16:27 [nftables 0/4] misc improvements and cleaning Eric Leblond
2013-09-16 16:27 ` Eric Leblond [this message]
2013-09-16 16:27 ` [nftables PATCH 2/4] Suppress non working examples Eric Leblond
2013-09-16 16:27 ` [nftables PATCH 3/4] Update chain creation format Eric Leblond
2013-09-16 20:21   ` Florian Westphal
2013-09-16 21:04     ` Eric Leblond
2013-09-16 16:27 ` [nftables PATCH 4/4] display family in table listing Eric Leblond
2013-09-17 11:14 ` [nftables 0/4] misc improvements and cleaning Pablo Neira Ayuso

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=1379348858-29187-2-git-send-email-eric@regit.org \
    --to=eric@regit.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 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).