Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252276
b: refs/heads/master
c: c74c0bf
h: refs/heads/master
v: v3
  • Loading branch information
Hans Schillstrom authored and Pablo Neira Ayuso committed May 27, 2011
1 parent b386dc5 commit 71e7cce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97242c85a2c8160eac5a6e945209b5b6ae8ab5a3
refs/heads/master: c74c0bfe0b61cf41a897c2444c038e0d3f600556
3 changes: 2 additions & 1 deletion trunk/include/net/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ struct netns_ipvs {
struct list_head rs_table[IP_VS_RTAB_SIZE];
/* ip_vs_app */
struct list_head app_list;

/* ip_vs_ftp */
struct ip_vs_app *ftp_app;
/* ip_vs_proto */
#define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */
struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE];
Expand Down
27 changes: 19 additions & 8 deletions trunk/net/netfilter/ipvs/ip_vs_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,35 +411,46 @@ static struct ip_vs_app ip_vs_ftp = {
static int __net_init __ip_vs_ftp_init(struct net *net)
{
int i, ret;
struct ip_vs_app *app = &ip_vs_ftp;
struct ip_vs_app *app;
struct netns_ipvs *ipvs = net_ipvs(net);

app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
if (!app)
return -ENOMEM;
INIT_LIST_HEAD(&app->a_list);
INIT_LIST_HEAD(&app->incs_list);
ipvs->ftp_app = app;

ret = register_ip_vs_app(net, app);
if (ret)
return ret;
goto err_exit;

for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {
if (!ports[i])
continue;
ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]);
if (ret)
break;
goto err_unreg;
pr_info("%s: loaded support on port[%d] = %d\n",
app->name, i, ports[i]);
}
return 0;

if (ret)
unregister_ip_vs_app(net, app);

err_unreg:
unregister_ip_vs_app(net, app);
err_exit:
kfree(ipvs->ftp_app);
return ret;
}
/*
* netns exit
*/
static void __ip_vs_ftp_exit(struct net *net)
{
struct ip_vs_app *app = &ip_vs_ftp;
struct netns_ipvs *ipvs = net_ipvs(net);

unregister_ip_vs_app(net, app);
unregister_ip_vs_app(net, ipvs->ftp_app);
kfree(ipvs->ftp_app);
}

static struct pernet_operations ip_vs_ftp_ops = {
Expand Down

0 comments on commit 71e7cce

Please sign in to comment.