]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IPVS]: Make sure ip_vs_ftp ports are valid
authorSimon Horman <horms@verge.net.au>
Thu, 14 Sep 2006 02:58:44 +0000 (19:58 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 18 Sep 2006 06:21:05 +0000 (23:21 -0700)
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 <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipvs/ip_vs_ftp.c

index 347a66c055697219c2f7e16c2dfe2c3b630652fa..f0c553c038deb7d7c275366bd5b413ce4464a9ec 100644 (file)
@@ -373,6 +373,12 @@ static int __init ip_vs_ftp_init(void)
        for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {
                if (!ports[i])
                        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]);
                if (ret)
                        break;