diff options
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ftp.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ftp.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index a19a33ceb811..37fafb1fbcff 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c | |||
@@ -46,14 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | static int ports[IP_VS_APP_MAX_PORTS] = {21, 0}; | 47 | static int ports[IP_VS_APP_MAX_PORTS] = {21, 0}; |
48 | module_param_array(ports, int, NULL, 0); | 48 | module_param_array(ports, int, NULL, 0); |
49 | 49 | MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); | |
50 | /* | ||
51 | * Debug level | ||
52 | */ | ||
53 | #ifdef CONFIG_IP_VS_DEBUG | ||
54 | static int debug=0; | ||
55 | module_param(debug, int, 0); | ||
56 | #endif | ||
57 | 50 | ||
58 | 51 | ||
59 | /* Dummy variable */ | 52 | /* Dummy variable */ |
@@ -177,7 +170,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
177 | &start, &end) != 1) | 170 | &start, &end) != 1) |
178 | return 1; | 171 | return 1; |
179 | 172 | ||
180 | IP_VS_DBG(1-debug, "PASV response (%u.%u.%u.%u:%d) -> " | 173 | IP_VS_DBG(7, "PASV response (%u.%u.%u.%u:%d) -> " |
181 | "%u.%u.%u.%u:%d detected\n", | 174 | "%u.%u.%u.%u:%d detected\n", |
182 | NIPQUAD(from), ntohs(port), NIPQUAD(cp->caddr), 0); | 175 | NIPQUAD(from), ntohs(port), NIPQUAD(cp->caddr), 0); |
183 | 176 | ||
@@ -280,7 +273,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
280 | while (data <= data_limit - 6) { | 273 | while (data <= data_limit - 6) { |
281 | if (strnicmp(data, "PASV\r\n", 6) == 0) { | 274 | if (strnicmp(data, "PASV\r\n", 6) == 0) { |
282 | /* Passive mode on */ | 275 | /* Passive mode on */ |
283 | IP_VS_DBG(1-debug, "got PASV at %zd of %zd\n", | 276 | IP_VS_DBG(7, "got PASV at %zd of %zd\n", |
284 | data - data_start, | 277 | data - data_start, |
285 | data_limit - data_start); | 278 | data_limit - data_start); |
286 | cp->app_data = &ip_vs_ftp_pasv; | 279 | cp->app_data = &ip_vs_ftp_pasv; |
@@ -302,7 +295,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
302 | &start, &end) != 1) | 295 | &start, &end) != 1) |
303 | return 1; | 296 | return 1; |
304 | 297 | ||
305 | IP_VS_DBG(1-debug, "PORT %u.%u.%u.%u:%d detected\n", | 298 | IP_VS_DBG(7, "PORT %u.%u.%u.%u:%d detected\n", |
306 | NIPQUAD(to), ntohs(port)); | 299 | NIPQUAD(to), ntohs(port)); |
307 | 300 | ||
308 | /* Passive mode off */ | 301 | /* Passive mode off */ |
@@ -311,7 +304,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp, | |||
311 | /* | 304 | /* |
312 | * Now update or create a connection entry for it | 305 | * Now update or create a connection entry for it |
313 | */ | 306 | */ |
314 | IP_VS_DBG(1-debug, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n", | 307 | IP_VS_DBG(7, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n", |
315 | ip_vs_proto_name(iph->protocol), | 308 | ip_vs_proto_name(iph->protocol), |
316 | NIPQUAD(to), ntohs(port), NIPQUAD(cp->vaddr), 0); | 309 | NIPQUAD(to), ntohs(port), NIPQUAD(cp->vaddr), 0); |
317 | 310 | ||
@@ -372,11 +365,17 @@ static int __init ip_vs_ftp_init(void) | |||
372 | for (i=0; i<IP_VS_APP_MAX_PORTS; i++) { | 365 | for (i=0; i<IP_VS_APP_MAX_PORTS; i++) { |
373 | if (!ports[i]) | 366 | if (!ports[i]) |
374 | continue; | 367 | continue; |
368 | if (ports[i] < 0 || ports[i] > 0xffff) { | ||
369 | IP_VS_WARNING("ip_vs_ftp: Ignoring invalid " | ||
370 | "configuration port[%d] = %d\n", | ||
371 | i, ports[i]); | ||
372 | continue; | ||
373 | } | ||
375 | ret = register_ip_vs_app_inc(app, app->protocol, ports[i]); | 374 | ret = register_ip_vs_app_inc(app, app->protocol, ports[i]); |
376 | if (ret) | 375 | if (ret) |
377 | break; | 376 | break; |
378 | IP_VS_DBG(1-debug, "%s: loaded support on port[%d] = %d\n", | 377 | IP_VS_INFO("%s: loaded support on port[%d] = %d\n", |
379 | app->name, i, ports[i]); | 378 | app->name, i, ports[i]); |
380 | } | 379 | } |
381 | 380 | ||
382 | if (ret) | 381 | if (ret) |