--- ./src/comm/ConnOpener.cc.orig	2020-06-03 00:48:25 +0000
+++ ./src/comm/ConnOpener.cc	2020-06-03 00:49:12 +0000
@@ -411,7 +411,7 @@
     struct addrinfo *addr = NULL;
     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	2020-06-03 01:03:59 +0000
+++ ./src/comm.cc	2020-06-03 01:05:45 +0000
@@ -126,7 +126,7 @@
     debugs(5,8, "comm_udp_recvfrom: FD " << fd << " from " << from);
     struct addrinfo *AI = NULL;
     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;
@@ -180,7 +180,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, MYNAME << "Failed to retrieve TCP/UDP port number for socket: FD " << fd << ": " << xstrerr(xerrno));
         Ip::Address::FreeAddr(addr);
--- ./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/comm/TcpAcceptor.cc.orig	2020-06-17 07:18:45 +0000
+++ ./src/comm/TcpAcceptor.cc	2020-06-17 07:19:23 +0000
@@ -380,7 +380,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;
         debugs(50, DBG_IMPORTANT, "ERROR: getsockname() failed to locate local-IP on " << details << ": " << xstrerr(xerrno));
         Ip::Address::FreeAddr(gai);
--- ./src/comm/TcpAcceptor.cc.orig	2020-06-17 08:34:55 +0000
+++ ./src/comm/TcpAcceptor.cc	2020-06-17 08:35:57 +0000
@@ -354,7 +354,7 @@
     Ip::Address::InitAddr(gai);
 
     errcode = 0; // reset local errno copy.
-    if ((sock = accept(conn->fd, gai->ai_addr, &gai->ai_addrlen)) < 0) {
+    if ((sock = accept(conn->fd, gai->ai_addr,(socklen_t*) &gai->ai_addrlen)) < 0) {
         errcode = errno; // store last accept errno locally.
 
         Ip::Address::FreeAddr(gai);
--- ./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)) {
