From patchwork Mon Apr 30 15:16:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 155897 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 1FC2AB6F9F for ; Tue, 1 May 2012 01:17:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756171Ab2D3PRp (ORCPT ); Mon, 30 Apr 2012 11:17:45 -0400 Received: from mail.us.es ([193.147.175.20]:34552 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756126Ab2D3PRb (ORCPT ); Mon, 30 Apr 2012 11:17:31 -0400 Received: (qmail 21725 invoked from network); 30 Apr 2012 17:17:30 +0200 Received: from unknown (HELO us.es) (192.168.2.12) by us.es with SMTP; 30 Apr 2012 17:17:30 +0200 Received: (qmail 6519 invoked by uid 507); 30 Apr 2012 15:17:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on antivirus2 X-Spam-Level: X-Spam-Status: No, score=-97.0 required=7.5 tests=BAYES_50,KHOP_DYNAMIC, RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC, USER_IN_WHITELIST autolearn=disabled version=3.3.1 Received: from 127.0.0.1 by antivirus2 (envelope-from , uid 501) with qmail-scanner-2.08 (clamdscan: 0.97.4/14864. Clear:RC:1(127.0.0.1):. Processed in 0.024076 secs); 30 Apr 2012 15:17:29 -0000 Received: from unknown (HELO antivirus2) (127.0.0.1) by us.es with SMTP; 30 Apr 2012 15:17:29 -0000 Received: from 192.168.1.13 (192.168.1.13) by antivirus2 (F-Secure/fsigk_smtp/407/antivirus2); Mon, 30 Apr 2012 17:17:29 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/407/antivirus2) Received: (qmail 29837 invoked from network); 30 Apr 2012 17:17:29 +0200 Received: from 210.137.221.87.dynamic.jazztel.es (HELO localhost.localdomain) (pneira@us.es@87.221.137.210) by us.es with SMTP; 30 Apr 2012 17:17:29 +0200 From: pablo@netfilter.org To: netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH 8/8] netfilter: xt_CT: fix wrong checking in the timeout assignment path Date: Mon, 30 Apr 2012 17:16:55 +0200 Message-Id: <1335799015-2003-9-git-send-email-pablo@netfilter.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1335799015-2003-1-git-send-email-pablo@netfilter.org> References: <1335799015-2003-1-git-send-email-pablo@netfilter.org> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Pablo Neira Ayuso The current checking always succeeded. We have to check the first character of the string to check that it's empty, thus, skipping the timeout path. This fixes the use of the CT target without the timeout option. Signed-off-by: Pablo Neira Ayuso --- net/netfilter/xt_CT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index 59530e9..3746d8b 100644 --- a/net/netfilter/xt_CT.c +++ b/net/netfilter/xt_CT.c @@ -227,7 +227,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par) } #ifdef CONFIG_NF_CONNTRACK_TIMEOUT - if (info->timeout) { + if (info->timeout[0]) { typeof(nf_ct_timeout_find_get_hook) timeout_find_get; struct nf_conn_timeout *timeout_ext;