2005-09-15 17:58:23

by Benjamin LaHaise

[permalink] [raw]
Subject: Re: [NETFILTER]: Use correct type for "ports" module parameter

On Tue, Sep 13, 2005 at 06:00:23PM -0700, Linux Kernel Mailing List wrote:
> --- a/net/ipv4/netfilter/ip_conntrack_ftp.c
> +++ b/net/ipv4/netfilter/ip_conntrack_ftp.c
> @@ -29,9 +29,9 @@ static char *ftp_buffer;
> static DEFINE_SPINLOCK(ip_ftp_lock);
>
> #define MAX_PORTS 8
> -static int ports[MAX_PORTS];
> +static short ports[MAX_PORTS];
> static int ports_c;
> -module_param_array(ports, int, &ports_c, 0400);
> +module_param_array(ports, short, &ports_c, 0400);

Shouldn't this be unsigned short? As near as I can tell the negative sign
extension will result in the same problem this patch was trying to fix as
the code does 'sprintf(tmpname, "ftp-%d", ports[i]);'...

-ben