From patchwork Thu Apr 19 23:32:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 153888 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EB289B7013 for ; Fri, 20 Apr 2012 09:28:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755963Ab2DSX2l (ORCPT ); Thu, 19 Apr 2012 19:28:41 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:47663 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753929Ab2DSX2j (ORCPT ); Thu, 19 Apr 2012 19:28:39 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1SL0mD-0000v9-UU; Thu, 19 Apr 2012 17:28:38 -0600 Received: from c-98-207-153-68.hsd1.ca.comcast.net ([98.207.153.68] helo=x61.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1SL0mA-00077o-Ud; Thu, 19 Apr 2012 17:28:37 -0600 Received: from fess.ebiederm.org (fess.int.ebiederm.org [192.168.4.7]) by x61.ebiederm.org (Postfix) with ESMTP id 1DBD539B91; Thu, 19 Apr 2012 16:29:13 -0700 (PDT) Received: by fess.ebiederm.org (Postfix, from userid 502) id 2EA5EC122E; Thu, 19 Apr 2012 16:32:39 -0700 (PDT) From: ebiederm@xmission.com (Eric W. Biederman) To: David Miller Cc: , "Serge E. Hallyn" , Gao feng , pablo@netfilter.org, Stephen Hemminger , Pavel Emelyanov References: Date: Thu, 19 Apr 2012 16:32:39 -0700 In-Reply-To: (Eric W. Biederman's message of "Thu, 19 Apr 2012 16:17:10 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=98.207.153.68; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX19j5kG5oND5ycNT7K2TyCtb4KK/+5fwAfA= X-SA-Exim-Connect-IP: 98.207.153.68 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sa02.xmission.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=8.0 tests=BAYES_00, DCC_CHECK_NEGATIVE, T_TooManySym_01, UNTRUSTED_Relay, XMSubLong autolearn=disabled version=3.3.1 X-Spam-Report: * 0.1 XMSubLong Long Subject * -3.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0011] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.4 UNTRUSTED_Relay Comes from a non-trusted relay X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;David Miller X-Spam-Relay-Country: ** Subject: [PATCH net-next 08/19] net ipv4: Remove the unneeded registration of an empty net/ipv4/neigh X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Fri, 06 Aug 2010 16:31:04 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org sysctl no longer requires explicit creation of directories. The neigh directory is always populated with at least a default entry so this won't cause any user visible changes. Delete the ipv4_path and the ipv4_skeleton these are no longer needed. Directly register the ipv4_route_table. And since I am an idiot remove the header definitions that I should have removed in the previous patch. Signed-off-by: Eric W. Biederman --- include/net/ipv6.h | 2 -- net/ipv4/route.c | 19 +------------------ 2 files changed, 1 insertions(+), 20 deletions(-) diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2d3fca37..e1a85ad 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -661,8 +661,6 @@ extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); extern int ipv6_sysctl_register(void); extern void ipv6_sysctl_unregister(void); -extern int ipv6_static_sysctl_register(void); -extern void ipv6_static_sysctl_unregister(void); #endif #endif /* _NET_IPV6_H */ diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f9c474e..4dd8027 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3343,23 +3343,6 @@ static ctl_table ipv4_route_table[] = { { } }; -static struct ctl_table empty[1]; - -static struct ctl_table ipv4_skeleton[] = -{ - { .procname = "route", - .mode = 0555, .child = ipv4_route_table}, - { .procname = "neigh", - .mode = 0555, .child = empty}, - { } -}; - -static __net_initdata struct ctl_path ipv4_path[] = { - { .procname = "net", }, - { .procname = "ipv4", }, - { }, -}; - static struct ctl_table ipv4_route_flush_table[] = { { .procname = "flush", @@ -3514,6 +3497,6 @@ int __init ip_rt_init(void) */ void __init ip_static_sysctl_init(void) { - kmemleak_not_leak(register_net_sysctl_table(&init_net, ipv4_path, ipv4_skeleton)); + register_net_sysctl(&init_net, "net/ipv4/route", ipv4_route_table); } #endif