From patchwork Tue Dec 25 23:11:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Engelhardt X-Patchwork-Id: 208129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F37F02C0087 for ; Wed, 26 Dec 2012 10:11:48 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600Ab2LYXLl (ORCPT ); Tue, 25 Dec 2012 18:11:41 -0500 Received: from ares07.inai.de ([5.9.24.206]:38909 "EHLO ares07.inai.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487Ab2LYXLe (ORCPT ); Tue, 25 Dec 2012 18:11:34 -0500 Received: by ares07.inai.de (Postfix, from userid 25121) id CE5CF96A0FA6; Wed, 26 Dec 2012 00:11:31 +0100 (CET) From: Jan Engelhardt To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org Subject: [PATCH 09/13] iptables: fix order of internal commands list Date: Wed, 26 Dec 2012 00:11:25 +0100 Message-Id: <1356477089-13241-10-git-send-email-jengelh@inai.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356477089-13241-1-git-send-email-jengelh@inai.de> References: <1356477089-13241-1-git-send-email-jengelh@inai.de> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Specifying -S on the command line would add 4096 (0x1000, 1<<12) to the cmd flags, but -S was in fact commands_v_options[13]. This led to a bogus option checking and an error message: $ iptables -A foo -S iptables v1.4.14: Cannot use -E with -A References: http://bugs.debian.org/642173 Signed-off-by: Jan Engelhardt --- iptables/ip6tables.c | 12 ++++++------ iptables/iptables.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index 0e11a9e..7f14dde 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -76,12 +76,12 @@ #define CMD_LIST 0x0020U #define CMD_FLUSH 0x0040U #define CMD_ZERO 0x0080U -#define CMD_NEW_CHAIN 0x0100U -#define CMD_DELETE_CHAIN 0x0200U -#define CMD_SET_POLICY 0x0400U -#define CMD_RENAME_CHAIN 0x0800U -#define CMD_LIST_RULES 0x1000U -#define CMD_ZERO_NUM 0x2000U +#define CMD_ZERO_NUM 0x0100U +#define CMD_NEW_CHAIN 0x0200U +#define CMD_DELETE_CHAIN 0x0400U +#define CMD_SET_POLICY 0x0800U +#define CMD_RENAME_CHAIN 0x1000U +#define CMD_LIST_RULES 0x2000U #define CMD_CHECK 0x4000U #define NUMBER_OF_CMD 16 static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z', diff --git a/iptables/iptables.c b/iptables/iptables.c index f765cf9..10a0417 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -72,12 +72,12 @@ #define CMD_LIST 0x0020U #define CMD_FLUSH 0x0040U #define CMD_ZERO 0x0080U -#define CMD_NEW_CHAIN 0x0100U -#define CMD_DELETE_CHAIN 0x0200U -#define CMD_SET_POLICY 0x0400U -#define CMD_RENAME_CHAIN 0x0800U -#define CMD_LIST_RULES 0x1000U -#define CMD_ZERO_NUM 0x2000U +#define CMD_ZERO_NUM 0x0100U +#define CMD_NEW_CHAIN 0x0200U +#define CMD_DELETE_CHAIN 0x0400U +#define CMD_SET_POLICY 0x0800U +#define CMD_RENAME_CHAIN 0x1000U +#define CMD_LIST_RULES 0x2000U #define CMD_CHECK 0x4000U #define NUMBER_OF_CMD 16 static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z',