]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove disabled classful networks code (#1547)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Sat, 28 Oct 2023 01:33:24 +0000 (01:33 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 28 Oct 2023 01:33:29 +0000 (01:33 +0000)
Removed ifdef-d code in networkFromInaddr() and mark that function as
static. The code was disabled since 1997 commit 429fdbe.

squid.dox
src/icmp/net_db.cc

index e9c12eab7cc4c0a2404f0ae6e6cb3499204bc509..c1b5ebf896caa212998b2130ee640b03740f89ce 100644 (file)
--- a/squid.dox
+++ b/squid.dox
@@ -2074,7 +2074,6 @@ PREDEFINED             = __cplusplus \
                          USE_ASYNC_IO \
                          USE_AUTH \
                          USE_CACHE_DIGESTS \
-                         USE_CLASSFUL \
                          USE_DELAY_POOLS \
                          USE_DEVPOLL \
                          USE_DLMALLOC \
index 664fffefd75914b21f61b2721397925a09d6f3c7..095843ae6b7315f5aae40344f5214df63c6cbe39 100644 (file)
@@ -92,7 +92,7 @@ CBDATA_CLASS_INIT(netdbExchangeState);
 static hash_table *addr_table = nullptr;
 static hash_table *host_table = nullptr;
 
-Ip::Address networkFromInaddr(const Ip::Address &a);
+static Ip::Address networkFromInaddr(const Ip::Address &a);
 static void netdbRelease(netdbEntry * n);
 
 static void netdbHashInsert(netdbEntry * n, Ip::Address &addr);
@@ -345,7 +345,7 @@ netdbSendPing(const ipcache_addrs *ia, const Dns::LookupDetails &, void *data)
     xfree(hostname);
 }
 
-Ip::Address
+static Ip::Address
 networkFromInaddr(const Ip::Address &in)
 {
     Ip::Address out;
@@ -359,22 +359,6 @@ networkFromInaddr(const Ip::Address &in)
         return out;
     }
 
-#if USE_CLASSFUL
-    struct in_addr b;
-
-    in.getInAddr(b);
-
-    if (IN_CLASSC(b.s_addr))
-        b.s_addr &= IN_CLASSC_NET;
-    else if (IN_CLASSB(b.s_addr))
-        b.s_addr &= IN_CLASSB_NET;
-    else if (IN_CLASSA(b.s_addr))
-        b.s_addr &= IN_CLASSA_NET;
-
-    out = b;
-
-#endif
-
     debugs(14, 5, "networkFromInaddr : Masked IPv4 Address to " << out << "/24.");
 
     /* use /24 for everything under IPv4 */