All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipvs: Expose ip_vs_ftp module parameters via sysfs.
@ 2011-09-12  9:15 Krzysztof Wilczynski
  2011-09-13  2:22 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Wilczynski @ 2011-09-12  9:15 UTC (permalink / raw)
  To: Simon Horman; +Cc: Patrick McHardy, netdev

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>
---
 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 4490a32..538d74e 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -52,8 +52,9 @@
  * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper
  * First port is set to the default port.
  */
+static unsigned int ports_count = 1;
 static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0};
-module_param_array(ports, ushort, NULL, 0);
+module_param_array(ports, ushort, &ports_count, 0444);
 MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands");
 
 
@@ -449,7 +450,7 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
 	if (ret)
 		goto err_exit;
 
-	for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {
+	for (i = 0; i < ports_count; i++) {
 		if (!ports[i])
 			continue;
 		ret = register_ip_vs_app_inc(net, app, app->protocol, ports[i]);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipvs: Expose ip_vs_ftp module parameters via sysfs.
  2011-09-12  9:15 [PATCH] ipvs: Expose ip_vs_ftp module parameters via sysfs Krzysztof Wilczynski
@ 2011-09-13  2:22 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2011-09-13  2:22 UTC (permalink / raw)
  To: Krzysztof Wilczynski; +Cc: Patrick McHardy, netdev

On Mon, Sep 12, 2011 at 10:15:15AM +0100, Krzysztof Wilczynski wrote:
> 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.

Thanks Krzysztof,

I have queued this up locally and will forward it on for inclusion in 3.2
once the kernel.org hiatus is over.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-13  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-12  9:15 [PATCH] ipvs: Expose ip_vs_ftp module parameters via sysfs Krzysztof Wilczynski
2011-09-13  2:22 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.