diff options
author | Hans Schillstrom <hans@schillstrom.com> | 2011-05-03 16:09:31 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-05-10 03:52:47 -0400 |
commit | 7a4f0761fce32ff4918a7c23b08db564ad33092d (patch) | |
tree | 20a123407182d544a8cbaa4d850e2ac96d3cfb37 /include/net | |
parent | 1ae132b0347907ac95b8bc9dba37934f59d2a508 (diff) |
IPVS: init and cleanup restructuring
DESCRIPTION
This patch tries to restore the initial init and cleanup
sequences that was before namspace patch.
Netns also requires action when net devices unregister
which has never been implemented. I.e this patch also
covers when a device moves into a network namespace,
and has to be released.
IMPLEMENTATION
The number of calls to register_pernet_device have been
reduced to one for the ip_vs.ko
Schedulers still have their own calls.
This patch adds a function __ip_vs_service_cleanup()
and an enable flag for the netfilter hooks.
The nf hooks will be enabled when the first service is loaded
and never disabled again, except when a namespace exit starts.
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
[horms@verge.net.au: minor edit to changelog]
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d516f00c8e0f..86aefed6140b 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -791,6 +791,7 @@ struct ip_vs_app { | |||
791 | /* IPVS in network namespace */ | 791 | /* IPVS in network namespace */ |
792 | struct netns_ipvs { | 792 | struct netns_ipvs { |
793 | int gen; /* Generation */ | 793 | int gen; /* Generation */ |
794 | int enable; /* enable like nf_hooks do */ | ||
794 | /* | 795 | /* |
795 | * Hash table: for real service lookups | 796 | * Hash table: for real service lookups |
796 | */ | 797 | */ |
@@ -1089,6 +1090,22 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) | |||
1089 | atomic_inc(&ctl_cp->n_control); | 1090 | atomic_inc(&ctl_cp->n_control); |
1090 | } | 1091 | } |
1091 | 1092 | ||
1093 | /* | ||
1094 | * IPVS netns init & cleanup functions | ||
1095 | */ | ||
1096 | extern int __ip_vs_estimator_init(struct net *net); | ||
1097 | extern int __ip_vs_control_init(struct net *net); | ||
1098 | extern int __ip_vs_protocol_init(struct net *net); | ||
1099 | extern int __ip_vs_app_init(struct net *net); | ||
1100 | extern int __ip_vs_conn_init(struct net *net); | ||
1101 | extern int __ip_vs_sync_init(struct net *net); | ||
1102 | extern void __ip_vs_conn_cleanup(struct net *net); | ||
1103 | extern void __ip_vs_app_cleanup(struct net *net); | ||
1104 | extern void __ip_vs_protocol_cleanup(struct net *net); | ||
1105 | extern void __ip_vs_control_cleanup(struct net *net); | ||
1106 | extern void __ip_vs_estimator_cleanup(struct net *net); | ||
1107 | extern void __ip_vs_sync_cleanup(struct net *net); | ||
1108 | extern void __ip_vs_service_cleanup(struct net *net); | ||
1092 | 1109 | ||
1093 | /* | 1110 | /* |
1094 | * IPVS application functions | 1111 | * IPVS application functions |