--- ./src/ipc.cc.orig	2020-06-03 00:59:16 +0000
+++ ./src/ipc.cc	2020-06-03 01:00:59 +0000
@@ -224,7 +224,7 @@
 
         Ip::Address::InitAddr(AI);
 
-        if (getsockname(crfd, AI->ai_addr, &AI->ai_addrlen) < 0) {
+        if (getsockname(crfd, AI->ai_addr,(socklen_t*) &AI->ai_addrlen) < 0) {
             xerrno = errno;
             Ip::Address::FreeAddr(AI);
             debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerr(xerrno));
--- ./src/ipc.cc.orig	2020-06-17 06:48:18 +0000
+++ ./src/ipc.cc	2020-06-17 06:48:44 +0000
@@ -209,7 +209,7 @@
     if (type == IPC_TCP_SOCKET || type == IPC_UDP_SOCKET) {
         Ip::Address::InitAddr(AI);
 
-        if (getsockname(pwfd, AI->ai_addr, &AI->ai_addrlen) < 0) {
+        if (getsockname(pwfd, AI->ai_addr, (socklen_t*) &AI->ai_addrlen) < 0) {
             xerrno = errno;
             Ip::Address::FreeAddr(AI);
             debugs(54, DBG_CRITICAL, "ipcCreate: getsockname: " << xstrerr(xerrno));
--- ./src/tests/testIpAddress.cc.orig	2023-05-08 11:44:04.482970399 +0000
+++ ./src/tests/testIpAddress.cc	2023-05-08 11:45:01.707328895 +0000
@@ -684,12 +684,12 @@
 #if HAVE_SIN6_LEN_IN_SAI
     CPPUNIT_ASSERT_EQUAL( ((struct sockaddr_in6*)expect->ai_addr)->sin6_len,
                           ((struct sockaddr_in6*)ipval->ai_addr)->sin6_len );
-    CPPUNIT_ASSERT_EQUAL( (socklen_t)((struct sockaddr_in6*)ipval->ai_addr)->sin6_len, ipval->ai_addrlen );
+    CPPUNIT_ASSERT_EQUAL( (socklen_t)((struct sockaddr_in6*)ipval->ai_addr)->sin6_len, (socklen_t)ipval->ai_addrlen );
 #endif
 #if HAVE_SIN_LEN_IN_SAI
     CPPUNIT_ASSERT_EQUAL( ((struct sockaddr_in*)expect->ai_addr)->sin_len,
                           ((struct sockaddr_in*)ipval->ai_addr)->sin_len );
-    CPPUNIT_ASSERT_EQUAL( (socklen_t)((struct sockaddr_in*)ipval->ai_addr)->sin_len, ipval->ai_addrlen );
+    CPPUNIT_ASSERT_EQUAL( (socklen_t)((struct sockaddr_in*)ipval->ai_addr)->sin_len, (socklen_t)ipval->ai_addrlen );
 #endif
 
     if (expect->ai_addrlen == sizeof(struct sockaddr_in)) {
--- ./src/comm/ConnOpener.cc.orig	2024-01-24 00:42:08.785974539 +0000
+++ ./src/comm/ConnOpener.cc	2024-01-24 00:43:27.576473380 +0000
@@ -432,7 +432,7 @@
     struct addrinfo *addr = nullptr;
     Ip::Address::InitAddr(addr);
 
-    if (getsockname(conn_->fd, addr->ai_addr, &(addr->ai_addrlen)) != 0) {
+    if (getsockname(conn_->fd, addr->ai_addr, (socklen_t*) &(addr->ai_addrlen)) != 0) {
         int xerrno = errno;
         debugs(50, DBG_IMPORTANT, "ERROR: Failed to retrieve TCP/UDP details for socket: " << conn_ << ": " << xstrerr(xerrno));
         Ip::Address::FreeAddr(addr);
--- ./src/comm.cc.orig	2024-01-24 00:43:59.120061650 +0000
+++ ./src/comm.cc	2024-01-24 00:45:19.840045006 +0000
@@ -128,7 +128,7 @@
     debugs(5,8, "comm_udp_recvfrom: FD " << fd << " from " << from);
     struct addrinfo *AI = nullptr;
     Ip::Address::InitAddr(AI);
-    int x = recvfrom(fd, buf, len, flags, AI->ai_addr, &AI->ai_addrlen);
+    int x = recvfrom(fd, buf, len, flags, AI->ai_addr, (socklen_t*) &AI->ai_addrlen);
     from = *AI;
     Ip::Address::FreeAddr(AI);
     return x;
@@ -182,7 +182,7 @@
 
     Ip::Address::InitAddr(addr);
 
-    if (getsockname(fd, addr->ai_addr, &(addr->ai_addrlen)) ) {
+    if (getsockname(fd, addr->ai_addr, (socklen_t*) &(addr->ai_addrlen)) ) {
         int xerrno = errno;
         debugs(50, DBG_IMPORTANT, "ERROR: " << MYNAME << "Failed to retrieve TCP/UDP port number for socket: FD " << fd << ": " << xstrerr(xerrno));
         Ip::Address::FreeAddr(addr);
--- ./src/comm/TcpAcceptor.cc.orig	2024-01-24 00:46:22.500045261 +0000
+++ ./src/comm/TcpAcceptor.cc	2024-01-24 00:48:26.703811244 +0000
@@ -349,7 +349,7 @@
     Ip::Address::InitAddr(gai);
 
     errcode = 0; // reset local errno copy.
-    const auto rawSock = accept(conn->fd, gai->ai_addr, &gai->ai_addrlen);
+    const auto rawSock = accept(conn->fd, gai->ai_addr, (socklen_t*) &gai->ai_addrlen);
     if (rawSock < 0) {
         errcode = errno; // store last accept errno locally.
 
@@ -378,7 +378,7 @@
     // lookup the local-end details of this new connection
     Ip::Address::InitAddr(gai);
     details->local.setEmpty();
-    if (getsockname(sock, gai->ai_addr, &gai->ai_addrlen) != 0) {
+    if (getsockname(sock, gai->ai_addr, (socklen_t*) &gai->ai_addrlen) != 0) {
         int xerrno = errno;
         Ip::Address::FreeAddr(gai);
         throw TextException(ToSBuf("getsockname() failed to locate local-IP on ", details, ": ", xstrerr(xerrno)), Here());
