Re: any idea? (acl.c broken for ASN)

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 14 Jun 2001 14:41:39 +0200

On 14 Jun 2001, at 2:31, Andres Kroonmaa <andre@online.ee> wrote:

> Program received signal SIGSEGV, Segmentation fault.
> asnAclInitialize (acls=0x82b92f0) at asn.c:145
> 145 asnCacheStart(i->i);
> (gdb) bt
> #0 asnAclInitialize (acls=0x82b92f0) at asn.c:145
> #1 0x00000001 in ?? ()
> #2 0x0804f6c0 in asnInit () at asn.c:162
> #3 0x08083dde in serverConnectionsOpen () at main.c:297
> #4 0x08084405 in mainInitialize () at main.c:522
> #5 0x08084871 in main (argc=4, argv=0xbffff8f4) at main.c:689

> (gdb) l
> 135 static void
> 136 asnAclInitialize(acl * acls)
> 137 {
> 138 acl *a;
> 139 intlist *i;
> 140 debug(53, 3) ("asnAclInitialize\n");
> 141 for (a = acls; a; a = a->next) {
> 142 if (a->type != ACL_DST_ASN && a->type != ACL_SRC_ASN)
> 143 continue;
> 144 for (i = a->data; i; i = i->next)
> 145 asnCacheStart(i->i);
> 146 }
> 147 }
> 148
> 149 /* initialize the radix tree structure */
> (gdb) p *a
> $3 = {name = "ESTAS", '\000' <repeats 26 times>, type = ACL_DST_ASN, data = 0x82b96c8,
> (gdb) p (intlist ) *0x82b96c8
> $6 = {i = 2380, next = 0x94c}

 Problem is actually during config parse.
 dst_as and src_as are parsed by aclParseIntRange(), but asn expects it to be
 of type intlist.

 The problem was introduced at around 18.Feb.01 with this mod (by hno):
 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/squid/squid/src/acl.c.diff?r1=1.21&r2=1.22&only_with_tag=MAIN

diff -u -r1.21 -r1.22
--- acl.c 2001/02/09 19:52:05 1.21
+++ acl.c 2001/02/18 11:18:47 1.22
..
@@ -42,7 +42,9 @@
 static void aclParseDomainList(void *curlist);
 static void aclParseUserList(void **current);
 static void aclParseIpList(void *curlist);
+#if UNUSED_CODE
 static void aclParseIntlist(void *curlist);
+#endif
 #if SQUID_SNMP
 static void aclParseWordList(void *curlist);
 #endif
..
@@ -779,9 +787,11 @@
        break;
     case ACL_SRC_ASN:
     case ACL_MAXCONN:
     case ACL_DST_ASN:
+#if SRC_RTT_NOT_YET_FINISHED
     case ACL_NETDB_SRC_RTT:
         aclParseIntlist(&A->data);
         break;
+#endif
     case ACL_URL_PORT:
     case ACL_MY_PORT:
         aclParseIntRange(&A->data);

 To me, it looks like above #endif was misplaced. All acl types above will
 fall through to aclParseIntRange() now. But then again, enclosing some
 code with UNUSED_CODE sounds like it was intentional.

 Are we in the process of converting all intList params into intRange params,
 or should I recover aclParseIntlist() ?

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu Jun 14 2001 - 06:47:11 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:03 MST