Commit 3f5af5b3 authored by Simon Horman's avatar Simon Horman Committed by David S. Miller

[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: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70e76b76
...@@ -373,6 +373,12 @@ static int __init ip_vs_ftp_init(void) ...@@ -373,6 +373,12 @@ static int __init ip_vs_ftp_init(void)
for (i=0; i<IP_VS_APP_MAX_PORTS; i++) { for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {
if (!ports[i]) if (!ports[i])
continue; continue;
if (ports[i] < 0 || ports[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]); ret = register_ip_vs_app_inc(app, app->protocol, ports[i]);
if (ret) if (ret)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment