diff mbox

[nft] netlink_delink_delinearize: don't store dependency unless relop checks is eq check

Message ID 20170509153711.26130-1-fw@strlen.de
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Florian Westphal May 9, 2017, 3:37 p.m. UTC
'ip protocol ne 6' is not a dependency for nexthdr protocol, and must
not be stored as such.

Fixes: 0b858391781ba308 ("src: annotate follow up dependency just after killing another")
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/netlink_delinearize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso May 15, 2017, 5:05 p.m. UTC | #1
On Tue, May 09, 2017 at 05:37:11PM +0200, Florian Westphal wrote:
> 'ip protocol ne 6' is not a dependency for nexthdr protocol, and must
> not be stored as such.
> 
> Fixes: 0b858391781ba308 ("src: annotate follow up dependency just after killing another")
> Signed-off-by: Florian Westphal <fw@strlen.de>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index a65a97da89fb..f0288cd49914 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -1332,7 +1332,7 @@  static void payload_match_expand(struct rule_pp_ctx *ctx,
 			payload_dependency_store(&ctx->pdctx, nstmt, base - stacked);
 		} else {
 			payload_dependency_kill(&ctx->pdctx, nexpr->left);
-			if (left->flags & EXPR_F_PROTOCOL)
+			if (expr->op == OP_EQ && left->flags & EXPR_F_PROTOCOL)
 				payload_dependency_store(&ctx->pdctx, nstmt, base - stacked);
 		}
 	}