From: Simon Horman <horms@verge.net.au>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org,
Wensong Zhang <wensong@linux-vs.org>,
Julian Anastasov <ja@ssi.bg>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Simon Horman <horms@verge.net.au>
Subject: [PATCH nf-next 52/84] ipvs: Pass ipvs not net into register_app and unregister_app
Date: Thu, 24 Sep 2015 09:52:37 +0900 [thread overview]
Message-ID: <1443055989-1306-53-git-send-email-horms@verge.net.au> (raw)
In-Reply-To: <1443055989-1306-1-git-send-email-horms@verge.net.au>
From: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 4 ++--
net/netfilter/ipvs/ip_vs_app.c | 6 ++++--
net/netfilter/ipvs/ip_vs_proto_sctp.c | 7 +++----
net/netfilter/ipvs/ip_vs_proto_tcp.c | 7 +++----
net/netfilter/ipvs/ip_vs_proto_udp.c | 7 +++----
5 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 02734eaae679..a7275ae18b96 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -517,9 +517,9 @@ struct ip_vs_protocol {
const struct sk_buff *skb,
struct ip_vs_proto_data *pd);
- int (*register_app)(struct net *net, struct ip_vs_app *inc);
+ int (*register_app)(struct netns_ipvs *ipvs, struct ip_vs_app *inc);
- void (*unregister_app)(struct net *net, struct ip_vs_app *inc);
+ void (*unregister_app)(struct netns_ipvs *ipvs, struct ip_vs_app *inc);
int (*app_conn_bind)(struct ip_vs_conn *cp);
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index dfd7b65b3d2a..f20f72c4ac80 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -78,6 +78,7 @@ static int
ip_vs_app_inc_new(struct net *net, struct ip_vs_app *app, __u16 proto,
__u16 port)
{
+ struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_protocol *pp;
struct ip_vs_app *inc;
int ret;
@@ -107,7 +108,7 @@ ip_vs_app_inc_new(struct net *net, struct ip_vs_app *app, __u16 proto,
}
}
- ret = pp->register_app(net, inc);
+ ret = pp->register_app(ipvs, inc);
if (ret)
goto out;
@@ -129,13 +130,14 @@ ip_vs_app_inc_new(struct net *net, struct ip_vs_app *app, __u16 proto,
static void
ip_vs_app_inc_release(struct net *net, struct ip_vs_app *inc)
{
+ struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_protocol *pp;
if (!(pp = ip_vs_proto_get(inc->protocol)))
return;
if (pp->unregister_app)
- pp->unregister_app(net, inc);
+ pp->unregister_app(ipvs, inc);
IP_VS_DBG(9, "%s App %s:%u unregistered\n",
pp->name, inc->name, ntohs(inc->port));
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index 8f39e0266ade..345fc7485f2e 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -487,13 +487,12 @@ static inline __u16 sctp_app_hashkey(__be16 port)
& SCTP_APP_TAB_MASK;
}
-static int sctp_register_app(struct net *net, struct ip_vs_app *inc)
+static int sctp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
struct ip_vs_app *i;
__u16 hash;
__be16 port = inc->port;
int ret = 0;
- struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_SCTP);
hash = sctp_app_hashkey(port);
@@ -511,9 +510,9 @@ out:
return ret;
}
-static void sctp_unregister_app(struct net *net, struct ip_vs_app *inc)
+static void sctp_unregister_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
- struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net_ipvs(net), IPPROTO_SCTP);
+ struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_SCTP);
atomic_dec(&pd->appcnt);
list_del_rcu(&inc->p_list);
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index 975aa69eec9c..94bea31ec388 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -595,13 +595,12 @@ static inline __u16 tcp_app_hashkey(__be16 port)
}
-static int tcp_register_app(struct net *net, struct ip_vs_app *inc)
+static int tcp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
struct ip_vs_app *i;
__u16 hash;
__be16 port = inc->port;
int ret = 0;
- struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
hash = tcp_app_hashkey(port);
@@ -621,9 +620,9 @@ static int tcp_register_app(struct net *net, struct ip_vs_app *inc)
static void
-tcp_unregister_app(struct net *net, struct ip_vs_app *inc)
+tcp_unregister_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
- struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net_ipvs(net), IPPROTO_TCP);
+ struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_TCP);
atomic_dec(&pd->appcnt);
list_del_rcu(&inc->p_list);
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index 1baa7494446a..234521ec9703 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -365,13 +365,12 @@ static inline __u16 udp_app_hashkey(__be16 port)
}
-static int udp_register_app(struct net *net, struct ip_vs_app *inc)
+static int udp_register_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
struct ip_vs_app *i;
__u16 hash;
__be16 port = inc->port;
int ret = 0;
- struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_UDP);
hash = udp_app_hashkey(port);
@@ -391,9 +390,9 @@ static int udp_register_app(struct net *net, struct ip_vs_app *inc)
static void
-udp_unregister_app(struct net *net, struct ip_vs_app *inc)
+udp_unregister_app(struct netns_ipvs *ipvs, struct ip_vs_app *inc)
{
- struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net_ipvs(net), IPPROTO_UDP);
+ struct ip_vs_proto_data *pd = ip_vs_proto_data_get(ipvs, IPPROTO_UDP);
atomic_dec(&pd->appcnt);
list_del_rcu(&inc->p_list);
--
2.1.4
next prev parent reply other threads:[~2015-09-24 0:52 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 0:51 [GIT PULL nf-next 00/84] Second Round of IPVS Updates for v4.4 Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 01/84] ipvs: Hoist computation of ipvs earlier in sctp_conn_schedule Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 02/84] ipvs: Don't use current in proc_do_defense_mode Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 03/84] ipvs: Use state->net in the ipvs forward functions Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 04/84] ipvs: Store ipvs not net in struct ip_vs_conn Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 05/84] ipvs: Store ipvs not net in struct ip_vs_conn_param Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 06/84] ipvs: Pass ipvs not net to ip_vs_fill_conn Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 07/84] ipvs: Store ipvs not net in struct ip_vs_service Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 08/84] ipvs: Pass ipvs not net to ip_vs_svc_fwm_hashkey Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 09/84] ipvs: Pass ipvs not net to __ip_vs_svc_fwm_find Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 10/84] ipvs: Pass ipvs not net to ip_vs_svc_hashkey Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 11/84] ipvs: Pass ipvs not net to __ip_vs_service_find Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 12/84] ipvs: Pass ipvs not net to ip_vs_service_find Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 13/84] ipvs: Pass ipvs not net to ip_vs_has_real_service Simon Horman
2015-09-24 0:51 ` [PATCH nf-next 14/84] ipvs: Pass ipvs not net to ip_vs_find_dest Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 15/84] ipvs: Pass ipvs not net to ip_vs_trash_cleanup Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 16/84] ipvs: Pass ipvs not net to __ip_vs_del_dest Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 17/84] ipvs: Pass ipvs not net to ip_vs_dest_trash_expire Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 18/84] ipvs: Cache ipvs in ip_vs_genl_set_cmd Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 19/84] ipvs: Pass ipvs not net to ip_vs_add_service Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 20/84] ipvs: Pass ipvs not net to ip_vs_flush Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 21/84] ipvs: Pass ipvs not net to ip_vs_service_net_cleanup Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 22/84] ipvs: Pass ipvs not net to ip_vs_zero_all Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 23/84] ipvs: Cache ipvs in ip_vs_in_icmp and ip_vs_in_icmp_v6 Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 24/84] ipvs: Pass ipvs not net to ip_vs_proto_data_get Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 25/84] ipvs: Pass ipvs not net to ip_vs_set_timeout Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 26/84] ipvs: Pass ipvs not net to __ip_vs_get_service_entries Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 27/84] ipvs: Pass ipvs not net to __ip_vs_get_dest_entries Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 28/84] ipvs: Pass ipvs not net to __ip_vs_get_timeouts Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 29/84] ipvs: Pass ipvs not net to ip_vs_genl_parse_service Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 30/84] ipvs: Pass ipvs not net to ip_vs_genl_find_service Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 31/84] ipvs: Pass ipvs not net to ip_vs_genl_new_daemon Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 32/84] ipvs: Pass ipvs not net to ip_vs_genl_del_daemon Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 33/84] ipvs: Pass ipvs not net to start_sync_thread Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 34/84] ipvs: Pass ipvs not net to stop_sync_thread Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 35/84] ipvs: Pass ipvs not net to make_send_sock Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 36/84] ipvs: Pass ipvs not net to make_receive_sock Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 37/84] ipvs: Store ipvs not net in struct ip_vs_sync_thread_data Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 38/84] ipvs: Pass ipvs not net to ip_vs_process_message Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 39/84] ipvs: Pass ipvs not net to ip_vs_sync_conn_v0 Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 40/84] ipvs: Pass ipvs not net to ip_vs_sync_conn Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 41/84] ipvs: Pass ipvs not net to ip_vs_proc_conn Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 42/84] ipvs: Pass ipvs not net to ip_vs_proc_sync_conn Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 43/84] ipvs: Pass ipvs not net to ip_vs_sync_net_init Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 44/84] ipvs: Pass ipvs not net to ip_vs_sync_net_cleanup Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 45/84] ipvs: Pass ipvs not net to ip_vs_genl_set_config Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 46/84] ipvs: Pass ipvs not net to ip_vs_start_estimator aned ip_vs_stop_estimator Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 47/84] ipvs: Pass ipvs not net to ip_vs_random_drop_entry Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 48/84] ipvs: Pass ipvs not net to ip_vs_control_net_(init|cleanup)_sysctl Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 49/84] ipvs: Pass ipvs not net into ip_vs_control_net_(init|cleanup) Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 50/84] ipvs: Pass ipvs not net to estimation_timer Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 51/84] ipvs: Pass ipvs not net to ip_vs_estimator_net_init and ip_vs_estimator_cleanup Simon Horman
2015-09-24 0:52 ` Simon Horman [this message]
2015-09-24 0:52 ` [PATCH nf-next 53/84] ipvs: Pass ipvs not net into ip_vs_app_inc_new Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 54/84] ipvs: Pass ipvs not net to register_ip_vs_app_inc Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 55/84] ipvs: Pass ipvs not net to register_ip_vs_app and unregister_ip_vs_app Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 56/84] ipvs: Pass ipvs not net into ip_vs_app_inc_release Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 57/84] ipvs: Pass ipvs not net into ip_vs_app_net_init and ip_vs_app_net_cleanup Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 58/84] ipvs: Pass ipvs not net into [un]register_ip_vs_proto_netns Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 59/84] ipvs: Pass ipvs not net into init_netns and exit_netns Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 60/84] ipvs: Pass ipvs into ip_vs_conn_fill_param_proto Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 61/84] ipvs: Pass ipvs into .conn_in_get and ip_vs_conn_in_get_proto Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 62/84] ipvs: Pass ipvs into conn_out_get Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 63/84] ipvs: Pass ipvs not net to ip_vs_conn_hashkey Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 64/84] ipvs: Pass ipvs not net into ip_vs_conn_net_flush Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 65/84] ipvs: Pass ipvs not net into ip_vs_conn_net_init and ip_vs_conn_net_cleanup Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 66/84] ipvs: Pass ipvs into .conn_schedule and ip_vs_try_to_schedule Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 67/84] ipvs: Better derivation of ipvs in ip_vs_tunnel_xmit Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 68/84] ipvs: Pass ipvs into __ip_vs_get_out_rt Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 69/84] ipvs: Pass ipvs into __ip_vs_get_out_rt_v6 Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 70/84] ipvs: Pass ipvs into ensure_mtu_is adequate Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 71/84] ipvs: Better derivation of ipvs in ip_vs_in_stats and ip_vs_out_stats Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 72/84] ipvs: Wrap sysctl_cache_bypass and remove ifdefs in ip_vs_leave Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 73/84] ipvs: Simplify ipvs and net access " Simon Horman
2015-09-24 0:52 ` [PATCH nf-next 74/84] ipvs: Pass ipvs not net into sysctl_nat_icmp_send Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 75/84] ipvs: Pass ipvs into ip_vs_out Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 76/84] ipvs: Pass ipvs into ip_vs_in Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 77/84] ipvs: Pass ipvs into ip_vs_in_icmp and ip_vs_in_icmp_v6 Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 78/84] ipvs: Pass ipvs into ip_vs_out_icmp and ip_vs_out_icmp_v6 Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 79/84] ipvs: Pass ipvs through ip_vs_route_me_harder into sysctl_snat_reroute Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 80/84] ipvs: Remove net argument from ip_vs_tcp_conn_listen Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 81/84] ipvs: Pass ipvs not net to ip_vs_protocol_net_(init|cleanup) Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 82/84] ipvs: Remove skb_net Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 83/84] ipvs: Remove skb_sknet Simon Horman
2015-09-24 0:53 ` [PATCH nf-next 84/84] ipvs: Pass ipvs into ip_vs_gather_frags Simon Horman
2015-09-25 0:01 ` [GIT PULL nf-next 00/84] Second Round of IPVS Updates for v4.4 Pablo Neira Ayuso
2015-09-28 15:23 ` [PATCH] ipvs: Don't protect ip_vs_addr_is_unicast with CONFIG_SYSCTL Eric W. Biederman
2015-09-28 18:45 ` Julian Anastasov
2015-09-29 0:55 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443055989-1306-53-git-send-email-horms@verge.net.au \
--to=horms@verge.net.au \
--cc=ebiederm@xmission.com \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=wensong@linux-vs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).