All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Leblond <eric@regit.org>
To: netfilter-devel@vger.kernel.org, pablo@netfilter.org,
	Alex Chapman <ajchapman88@hotmail.co.uk>
Cc: eric@regit.org
Subject: [nftables PATCH 3/3] verdict: fix delinearize in case of jump
Date: Mon, 18 Nov 2013 00:54:45 +0100	[thread overview]
Message-ID: <1384732485-12944-4-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1384732485-12944-1-git-send-email-eric@regit.org>

The name of the chain was not handled in case of a jump or a goto.
This patch adds parsing of the chain.

Reported-by: Alex Chapman <ajchapman88@hotmail.co.uk>
Signed-off-by: Eric Leblond <eric@regit.org>
---
 src/netlink_delinearize.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 3bb143b..7e4e38c 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -81,9 +81,13 @@ static void netlink_parse_immediate(struct netlink_parse_ctx *ctx,
 	struct stmt *stmt;
 	struct expr *expr;
 
-	if (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_VERDICT))
+	if (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_VERDICT)) {
 		nld.verdict = nft_rule_expr_get_u32(nle, NFT_EXPR_IMM_VERDICT); 
-	else if (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_DATA)) {
+		if  (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_CHAIN)) {
+			nld.chain = nft_rule_expr_get(nle, NFT_EXPR_IMM_CHAIN,
+						      &nld.len);
+		}
+	} else if (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_DATA)) {
 		nld.value = nft_rule_expr_get(nle, NFT_EXPR_IMM_DATA, &nld.len);
 	}
 
-- 
1.8.4.3


  parent reply	other threads:[~2013-11-18  0:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 16:53 nftables jump <chain> target invalid argument Alex Chapman
2013-11-15 13:06 ` Eric Leblond
2013-11-17 23:54 ` [nftables PATCh 0/3] Fix jump operation Eric Leblond
2013-11-17 23:54   ` [nftables PATCH 1/3] expression: fix indent Eric Leblond
2013-11-17 23:54   ` [nftables PATCH 2/3] jump: fix logic in netlink linearize Eric Leblond
2013-11-17 23:54   ` Eric Leblond [this message]
2013-11-19 20:13   ` [nftables PATCh 0/3] Fix jump operation 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=1384732485-12944-4-git-send-email-eric@regit.org \
    --to=eric@regit.org \
    --cc=ajchapman88@hotmail.co.uk \
    --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 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.