Skip to contentSkip to conversation

: Use correct type for "ports" module parameter

NETFILTER Benjamin LaHaise 1 participant 1 message Sep 15, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

net/ipv4/netfilter/ip_conntrack_ftp.c static char *ftp_buffer; · line 34

Quoted 11 lines · Linux Kernel Mailing List
net/ipv4/netfilter/ip_conntrack_ftp.c +2 -2
@@ -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