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 2/3] jump: fix logic in netlink linearize.
Date: Mon, 18 Nov 2013 00:54:44 +0100	[thread overview]
Message-ID: <1384732485-12944-3-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1384732485-12944-1-git-send-email-eric@regit.org>

Logic in the test was inverted. The result was the jump string
not to be set.

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

diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index da8be20..e64e92a 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -440,7 +440,8 @@ static void netlink_gen_immediate(struct netlink_linearize_ctx *ctx,
 		nft_rule_expr_set(nle, NFT_EXPR_IMM_DATA, nld.value, nld.len);
 		break;
 	case EXPR_VERDICT:
-		if (nft_rule_expr_is_set(nle, NFT_EXPR_IMM_CHAIN)) {
+		if ((expr->chain != NULL) &&
+		    !nft_rule_expr_is_set(nle, NFT_EXPR_IMM_CHAIN)) {
 			nft_rule_expr_set_str(nle, NFT_EXPR_IMM_CHAIN,
 					      nld.chain);
 		}
-- 
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   ` Eric Leblond [this message]
2013-11-17 23:54   ` [nftables PATCH 3/3] verdict: fix delinearize in case of jump Eric Leblond
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-3-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.