From patchwork Thu Dec 30 10:50:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Schillstrom X-Patchwork-Id: 76969 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 7E7F4B70CC for ; Thu, 30 Dec 2010 21:51:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754289Ab0L3KvV (ORCPT ); Thu, 30 Dec 2010 05:51:21 -0500 Received: from smtp-gw21.han.skanova.net ([81.236.55.21]:39958 "EHLO smtp-gw21.han.skanova.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753590Ab0L3KvT (ORCPT ); Thu, 30 Dec 2010 05:51:19 -0500 Received: from dmz.mlab.se (213.65.94.224) by smtp-gw21.han.skanova.net (8.5.133) id 4D0766EF00646D12; Thu, 30 Dec 2010 11:51:17 +0100 Received: from quad.mlab.se (quad.mlab.se [172.24.1.70]) by dmz.mlab.se (8.13.8/8.13.8) with ESMTP id oBUApE41028002; Thu, 30 Dec 2010 11:51:14 +0100 Received: from quad.mlab.se (localhost.localdomain [127.0.0.1]) by quad.mlab.se (8.14.4/8.14.4) with ESMTP id oBUApELN027244; Thu, 30 Dec 2010 11:51:14 +0100 Received: (from hans@localhost) by quad.mlab.se (8.14.4/8.14.4/Submit) id oBUApEPl027243; Thu, 30 Dec 2010 11:51:14 +0100 From: hans@schillstrom.com To: horms@verge.net.au, ja@ssi.bg, daniel.lezcano@free.fr, wensong@linux-vs.org, lvs-devel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org Cc: Hans Schillstrom Subject: [*v3 PATCH 09/22] IPVS: netns preparation for proto_ah_esp Date: Thu, 30 Dec 2010 11:50:53 +0100 Message-Id: <1293706266-27152-10-git-send-email-hans@schillstrom.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1293706266-27152-1-git-send-email-hans@schillstrom.com> References: <1293706266-27152-1-git-send-email-hans@schillstrom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Hans Schillstrom In this phase (one), all local vars will be moved to ipvs struct. Remaining work, add param struct net *net to a couple of functions that common for all protos. Signed-off-by: Hans Schillstrom --- net/netfilter/ipvs/ip_vs_proto.c | 6 ++++++ net/netfilter/ipvs/ip_vs_proto_ah_esp.c | 20 ++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index fd3a7a8..1089248 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c @@ -316,6 +316,12 @@ static int __net_init __ip_vs_protocol_init(struct net *net) #ifdef CONFIG_IP_VS_PROTO_SCTP register_ip_vs_proto_netns(net, &ip_vs_protocol_sctp); #endif +#ifdef CONFIG_IP_VS_PROTO_AH + register_ip_vs_proto_netns(net, &ip_vs_protocol_ah); +#endif +#ifdef CONFIG_IP_VS_PROTO_ESP + register_ip_vs_proto_netns(net, &ip_vs_protocol_esp); +#endif return 0; } diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c index 3a04611..b8b37fa 100644 --- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c +++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c @@ -117,26 +117,14 @@ ah_esp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, return 0; } -static void ah_esp_init(struct ip_vs_protocol *pp) -{ - /* nothing to do now */ -} - - -static void ah_esp_exit(struct ip_vs_protocol *pp) -{ - /* nothing to do now */ -} - - #ifdef CONFIG_IP_VS_PROTO_AH struct ip_vs_protocol ip_vs_protocol_ah = { .name = "AH", .protocol = IPPROTO_AH, .num_states = 1, .dont_defrag = 1, - .init = ah_esp_init, - .exit = ah_esp_exit, + .init = NULL, + .exit = NULL, .conn_schedule = ah_esp_conn_schedule, .conn_in_get = ah_esp_conn_in_get, .conn_out_get = ah_esp_conn_out_get, @@ -159,8 +147,8 @@ struct ip_vs_protocol ip_vs_protocol_esp = { .protocol = IPPROTO_ESP, .num_states = 1, .dont_defrag = 1, - .init = ah_esp_init, - .exit = ah_esp_exit, + .init = NULL, + .exit = NULL, .conn_schedule = ah_esp_conn_schedule, .conn_in_get = ah_esp_conn_in_get, .conn_out_get = ah_esp_conn_out_get,