]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
MinGW: fix error: cannot convert 'size_t*' to 'int*' (#1822)
authorAmos Jeffries <yadij@users.noreply.github.com>
Mon, 27 May 2024 19:46:44 +0000 (19:46 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 27 May 2024 22:21:11 +0000 (22:21 +0000)
Remove struct addrinfo as we do.

src/comm/ConnOpener.cc

index 4473fe41a164d27a5482f75e6fbfc980650e87f9..a6bc51b341e1d3f29af2a0b6cc32974a28078497 100644 (file)
@@ -429,18 +429,15 @@ Comm::ConnOpener::cancelSleep()
 void
 Comm::ConnOpener::lookupLocalAddress()
 {
-    struct addrinfo *addr = nullptr;
-    Ip::Address::InitAddr(addr);
-
-    if (getsockname(conn_->fd, addr->ai_addr, &(addr->ai_addrlen)) != 0) {
+    struct sockaddr_storage addr = {};
+    socklen_t len = sizeof(addr);
+    if (getsockname(conn_->fd, reinterpret_cast<struct sockaddr *>(&addr), &len) != 0) {
         int xerrno = errno;
         debugs(50, DBG_IMPORTANT, "ERROR: Failed to retrieve TCP/UDP details for socket: " << conn_ << ": " << xstrerr(xerrno));
-        Ip::Address::FreeAddr(addr);
         return;
     }
 
-    conn_->local = *addr;
-    Ip::Address::FreeAddr(addr);
+    conn_->local = addr;
     debugs(5, 6, conn_);
 }