From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Eastep Subject: [PATCH] IPSET parsing buglet Date: Fri, 06 May 2005 09:19:34 -0700 Message-ID: <427B9916.7060305@shorewall.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060301070609020402050302" Cc: kadlec@blackhole.kfki.hu Return-path: To: netfilter-devel@lists.netfilter.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org This is a multi-part message in MIME format. --------------060301070609020402050302 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit gateway:/etc/test# ipset -R < ipsets ipset v2.2.1: Missing cidr from `218.85.95.0/24' Try `ipset -H' or 'ipset --help' for more information. gateway:/etc/test# The 'ipsets' file contains: # Generated by ipset 2.2.1 on Fri May 6 07:05:09 2005 -N SMTP portmap --from 1 --to 31 -A SMTP 25 -N Blacklistnets nethash --hashsize 1024 --probes 2 --resize 50 -A Blacklistnets 218.85.95.0/24 -B Blacklistnets 218.85.95.0/24 -b SMTP COMMIT # Completed on Fri May 6 07:05:09 2005 The error is occurring on the -B command. The attached patch corrects the problem. -Tom -- Tom Eastep \ Nothing is foolproof to a sufficiently talented fool Shoreline, \ http://shorewall.net Washington USA \ teastep@shorewall.net PGP Public Key \ https://lists.shorewall.net/teastep.pgp.key --------------060301070609020402050302 Content-Type: text/x-patch; name="parsebug.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="parsebug.diff" --- ../ipset.jk/ipset_nethash.c 2005-04-17 21:07:12.000000000 -0700 +++ ipset_nethash.c 2005-05-06 09:15:57.000000000 -0700 @@ -296,7 +296,7 @@ static void parse_net(const char *str, ip_set_ip_t *ip) { char *saved = strdup(str); - char *ptr, *tmp; + char *ptr, *tmp = saved; ip_set_ip_t cidr; ptr = strsep(&tmp, "/"); --------------060301070609020402050302--