From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Sat, 28 Oct 2023 01:33:24 +0000 (+0000) Subject: Remove disabled classful networks code (#1547) X-Git-Tag: SQUID_7_0_1~311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b2c9f87d88b727f1c04597414c435b19b5395d0;p=thirdparty%2Fsquid.git Remove disabled classful networks code (#1547) Removed ifdef-d code in networkFromInaddr() and mark that function as static. The code was disabled since 1997 commit 429fdbe. --- diff --git a/squid.dox b/squid.dox index e9c12eab7c..c1b5ebf896 100644 --- 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 \ diff --git a/src/icmp/net_db.cc b/src/icmp/net_db.cc index 664fffefd7..095843ae6b 100644 --- a/src/icmp/net_db.cc +++ b/src/icmp/net_db.cc @@ -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 */