From patchwork Thu Oct 26 23:06:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 830976 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yNN0v5mm6z9s74 for ; Fri, 27 Oct 2017 10:06:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406AbdJZXGX (ORCPT ); Thu, 26 Oct 2017 19:06:23 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:59782 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932334AbdJZXGX (ORCPT ); Thu, 26 Oct 2017 19:06:23 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.84_2) (envelope-from ) id 1e7rDy-0005um-53; Fri, 27 Oct 2017 01:06:06 +0200 From: Florian Westphal To: Cc: Florian Westphal Subject: [PATCH nft 8/8] tests: silence test case Date: Fri, 27 Oct 2017 01:06:11 +0200 Message-Id: <20171026230611.14269-9-fw@strlen.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171026230611.14269-1-fw@strlen.de> References: <20171026230611.14269-1-fw@strlen.de> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org removes this harmless warning: 'ip saddr 1.2.3.4 tcp dport 22' mismatches 'ip protocol 6 ip saddr 1.2.3.4 tcp dport 22' alternative fix is to track the number of payload expressions seen in the current dependency base so we know that we had another expression (ip saddr in this case) besides the 'ip protocol' statement. But because nft doesn't add such a dependency on its own (it would have added 'meta l4proto tcp' without the ip protocol 6 statement) it seems simpler to just let nft print the rule as-is instead of adding more code. Signed-off-by: Florian Westphal --- tests/py/inet/ip_tcp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/py/inet/ip_tcp.t b/tests/py/inet/ip_tcp.t index f2a28ebdd531..4eebe3865d76 100644 --- a/tests/py/inet/ip_tcp.t +++ b/tests/py/inet/ip_tcp.t @@ -8,8 +8,8 @@ # must not remove ip dependency -- ONLY ipv4 packets should be matched ip protocol tcp tcp dport 22;ok;ip protocol 6 tcp dport 22 -# can remove it here, ip protocol is implied via saddr. -ip protocol tcp ip saddr 1.2.3.4 tcp dport 22;ok;ip saddr 1.2.3.4 tcp dport 22 +# could be remove here, ip protocol is implied via saddr. +ip protocol tcp ip saddr 1.2.3.4 tcp dport 22;ok;ip protocol 6 ip saddr 1.2.3.4 tcp dport 22 # but not here. ip protocol tcp counter ip saddr 1.2.3.4 tcp dport 22;ok;ip protocol 6 counter ip saddr 1.2.3.4 tcp dport 22