diff options
author | Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> | 2011-09-12 05:15:15 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-11-01 04:19:21 -0400 |
commit | 52669dfa8312b7f63b963df6d01dc5513398f4c4 (patch) | |
tree | 3a3b967e937b72225d0335c01c38901ee45369ce /net/netfilter | |
parent | f83347df57113e54e999aa2491be3f685c0c262d (diff) |
ipvs: Expose ip_vs_ftp module parameters via sysfs.
This is to expose "ports" parameter via sysfs so it can be read
at any time in order to determine what port or ports were passed
to the module at the point when it was loaded.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 4490a32ad5b2..538d74ee4f68 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -52,8 +52,9 @@ | |||
52 | * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper | 52 | * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper |
53 | * First port is set to the default port. | 53 | * First port is set to the default port. |
54 | */ | 54 | */ |
55 | static unsigned int ports_count = 1; | ||
55 | static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0}; | 56 | static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0}; |
56 | module_param_array(ports, ushort, NULL, 0); | 57 | module_param_array(ports, ushort, &ports_count, 0444); |
57 | MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); | 58 | MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); |
58 | 59 | ||
59 | 60 | ||
@@ -449,7 +450,7 @@ static int __net_init __ip_vs_ftp_init(struct net *net) | |||
449 | if (ret) | 450 | if (ret) |
450 | goto err_exit; | 451 | goto err_exit; |
451 | 452 | ||
452 | for (i=0; i<IP_VS_APP_MAX_PORTS; i++) { | 453 | for (i = 0; i < ports_count; i++) { |
453 | if (!ports[i]) | 454 | if (!ports[i]) |
454 | continue; | 455 | continue; |
455 | ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]); | 456 | ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]); |