]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
use integer flag for init
authorwessels <>
Mon, 8 Apr 1996 22:01:05 +0000 (22:01 +0000)
committerwessels <>
Mon, 8 Apr 1996 22:01:05 +0000 (22:01 +0000)
src/cache_cf.cc

index c7ea22d5cbae45e117103642282fe0162dab615b..d954f9aa682a89c1008e250c384f7a825124b063 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cache_cf.cc,v 1.20 1996/04/06 00:53:03 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.21 1996/04/08 16:01:05 wessels Exp $ */
 
 /* DEBUG: Section 3             cache_cf: Configuration file parsing */
 
@@ -181,16 +181,19 @@ ip_access_type ip_access_check(address, list)
      struct in_addr address;
      ip_acl *list;
 {
-    static struct in_addr localhost =
-    {};                                /* Initialized to all zero */
+    static int init = 0;
+    static struct in_addr localhost;
     ip_acl *p = NULL;
     struct in_addr naddr;      /* network byte-order IP addr */
 
     if (!list)
        return IP_ALLOW;
 
-    if (!localhost.s_addr)
+    if (!init) {
+       memset((char *) &localhost, '\0', sizeof(struct in_addr));
        localhost.s_addr = inet_addr("127.0.0.1");
+       init = 1;
+    }
 
     naddr.s_addr = address.s_addr;
     if (naddr.s_addr == localhost.s_addr)