Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755978AbYFBLLy (ORCPT ); Mon, 2 Jun 2008 07:11:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753233AbYFBLLp (ORCPT ); Mon, 2 Jun 2008 07:11:45 -0400 Received: from rv-out-0506.google.com ([209.85.198.231]:26012 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205AbYFBLLo (ORCPT ); Mon, 2 Jun 2008 07:11:44 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=AOPEUfOKhuUyzJXtjx1aHmuRwTJijgHZ9pQCNHjWnoBX/wG+jdpvYMzS7J/TXSlhsaSQRY2TJXsccLk2EGyMoOuMH3unFcLxCdU8wRv5rpix7OYftnmEDFdUxfroxqnyknjlvqhuy7xUf+pGTg9nAPsGcgom+7N8uNw0kyUzWK4= Message-ID: Date: Mon, 2 Jun 2008 14:11:42 +0300 From: "Rami Rosen" To: "Patrick McHardy" Subject: [PATCH net-2.6] [NETFILTER] Misc Cleanups. Cc: "David Miller" , netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <4843C183.4060008@trash.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_10188_10248701.1212405102526" References: <20080601.234549.229050768.davem@davemloft.net> <4843C183.4060008@trash.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4237 Lines: 109 ------=_Part_10188_10248701.1212405102526 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, - Thanks for your comments; I was not aware that this issues occur in other places too; attached here is another patch, fixing where applicable in ip6_queue and nfnetlink_queue. 1) in net/ipv6/netfilter/ip6_queue.c - No need to perform data_len = 0 in the switch command, since data_len is initialized to 0 in the beginning of the ipq_build_packet_message() method - We can reach nlmsg_failure only from one place; skb is sure to be NULL when getting there; since skb is NULL, there is no need to check this fact and call kfree_skb(). 2) in net/netfilter/nfnetlink_queue.c: - No need to perform data_len = 0 in the switch command, since data_len is initialized to 0 in the beginning of the nfqnl_build_packet_message() method (Note: here, as opposed to previous patch, nlmsg_failure must check skb and free it if it is not NULL, so the call to kfree_skb() is needed , so it is not removed) Regards, Rami Rosen Signed-off-by: Rami Rosen On Mon, Jun 2, 2008 at 12:46 PM, Patrick McHardy wrote: > David Miller wrote: >> >> Forwarding to netfilter-devel where this belongs... > > Thanks. > >> In this patch, these three fixes were made in >> net/ipv4/netfilter/ip_queue.c: >> >> 1) No need to perform data_len = 0 in the switch command, since >> data_len >> is initialized to 0 in the beginning of the method >> ,ipq_build_packet_message(). >> >> 2) We can reach nlmsg_failure only from one place; skb is sure to >> be NULL >> when getting there; since skb is NULL, there is no need to check >> this fact >> and call kfree_skb(). >> >> 3) Add #ifdef CONFIG_PROC_FS when removing the VFS entry, >> proc_net_remove(&init_net, IPQ_PROC_FS_NAME); >> >> >> Regards, >> Rami Rosen >> >> >> Signed-off-by: Rami Rosen > > 1) also affects ip6_queue and nfnetlink_queue > 2) also affects ip6_queue > 3) is unnecessary since proc_net_remove is a NOP without > CONFIG_PROC_FS > > Please update your patch to also change ip6_queue and > nfnetlink_queue where applicable. Thanks. > > > ------=_Part_10188_10248701.1212405102526 Content-Type: text/plain; name=patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fgyyjphc0 Content-Disposition: attachment; filename=patch.txt ZGlmZiAtLWdpdCBhL25ldC9pcHY2L25ldGZpbHRlci9pcDZfcXVldWUuYyBiL25ldC9pcHY2L25l dGZpbHRlci9pcDZfcXVldWUuYwppbmRleCAyZWZmM2FlLi4xYjg4MTVmIDEwMDY0NAotLS0gYS9u ZXQvaXB2Ni9uZXRmaWx0ZXIvaXA2X3F1ZXVlLmMKKysrIGIvbmV0L2lwdjYvbmV0ZmlsdGV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fbW9kZSkgewogCWNh c2UgTkZRTkxfQ09QWV9NRVRBOgogCWNhc2UgTkZRTkxfQ09QWV9OT05FOgotCQlkYXRhX2xlbiA9 IDA7CiAJCWJyZWFrOwogCiAJY2FzZSBORlFOTF9DT1BZX1BBQ0tFVDoK ------=_Part_10188_10248701.1212405102526-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/