From 70e76b768bac81149c8c189e781c3f130ea2eba5 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 13 Sep 2006 19:57:54 -0700 Subject: [IPVS]: auto-help for ip_vs_ftp Fill in a help message for the ports option to ip_vs_ftp Signed-Off-By: Simon Horman Signed-off-by: David S. Miller --- net/ipv4/ipvs/ip_vs_ftp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'net/ipv4/ipvs/ip_vs_ftp.c') diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index a19a33ceb811..347a66c05569 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c @@ -46,6 +46,7 @@ */ static int ports[IP_VS_APP_MAX_PORTS] = {21, 0}; module_param_array(ports, int, NULL, 0); +MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); /* * Debug level -- cgit v1.2.3 From 3f5af5b353ca36aca4f8a46e3da2172f669dbbbc Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 13 Sep 2006 19:58:44 -0700 Subject: [IPVS]: Make sure ip_vs_ftp ports are valid I'm not entirely sure what happens in the case of a valid port, at best it'll be silently ignored. This patch ignores them a little more verbosely. Signed-Off-By: Simon Horman Signed-off-by: David S. Miller --- net/ipv4/ipvs/ip_vs_ftp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/ipv4/ipvs/ip_vs_ftp.c') diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index 347a66c05569..f0c553c038de 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c @@ -373,6 +373,12 @@ static int __init ip_vs_ftp_init(void) for (i=0; i 0xffff) { + IP_VS_WARNING("ip_vs_ftp: Ignoring invalid " + "configuration port[%d] = %d\n", + i, ports[i]); + continue; + } ret = register_ip_vs_app_inc(app, app->protocol, ports[i]); if (ret) break; -- cgit v1.2.3 From b552216ff1340a056aa0e12da68203902ae81d2c Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 13 Sep 2006 19:59:23 -0700 Subject: [IPVS]: remove the debug option go ip_vs_ftp This patch makes the debuging behaviour of this code more consistent with the rest of IPVS. Signed-Off-By: Simon Horman Signed-off-by: David S. Miller --- net/ipv4/ipvs/ip_vs_ftp.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'net/ipv4/ipvs/ip_vs_ftp.c') diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index f0c553c038de..37fafb1fbcff 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c @@ -48,14 +48,6 @@ static int ports[IP_VS_APP_MAX_PORTS] = {21, 0}; module_param_array(ports, int, NULL, 0); MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); -/* - * Debug level - */ -#ifdef CONFIG_IP_VS_DEBUG -static int debug=0; -module_param(debug, int, 0); -#endif - /* Dummy variable */ static int ip_vs_ftp_pasv; @@ -178,7 +170,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, &start, &end) != 1) return 1; - IP_VS_DBG(1-debug, "PASV response (%u.%u.%u.%u:%d) -> " + IP_VS_DBG(7, "PASV response (%u.%u.%u.%u:%d) -> " "%u.%u.%u.%u:%d detected\n", NIPQUAD(from), ntohs(port), NIPQUAD(cp->caddr), 0); @@ -281,7 +273,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, while (data <= data_limit - 6) { if (strnicmp(data, "PASV\r\n", 6) == 0) { /* Passive mode on */ - IP_VS_DBG(1-debug, "got PASV at %zd of %zd\n", + IP_VS_DBG(7, "got PASV at %zd of %zd\n", data - data_start, data_limit - data_start); cp->app_data = &ip_vs_ftp_pasv; @@ -303,7 +295,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, &start, &end) != 1) return 1; - IP_VS_DBG(1-debug, "PORT %u.%u.%u.%u:%d detected\n", + IP_VS_DBG(7, "PORT %u.%u.%u.%u:%d detected\n", NIPQUAD(to), ntohs(port)); /* Passive mode off */ @@ -312,7 +304,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, /* * Now update or create a connection entry for it */ - IP_VS_DBG(1-debug, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n", + IP_VS_DBG(7, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n", ip_vs_proto_name(iph->protocol), NIPQUAD(to), ntohs(port), NIPQUAD(cp->vaddr), 0); @@ -382,8 +374,8 @@ static int __init ip_vs_ftp_init(void) ret = register_ip_vs_app_inc(app, app->protocol, ports[i]); if (ret) break; - IP_VS_DBG(1-debug, "%s: loaded support on port[%d] = %d\n", - app->name, i, ports[i]); + IP_VS_INFO("%s: loaded support on port[%d] = %d\n", + app->name, i, ports[i]); } if (ret) -- cgit v1.2.3