Skip to content

Commit

Permalink
fix ipv6 port not be listened
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglyutao.zlt committed Jul 19, 2024
1 parent bd75c9a commit 81eeae9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/obproxy/iocore/net/ob_inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ inline bool ops_is_ip_any(const sockaddr &ip)
inline bool ops_ip_copy(sockaddr &dst, const sockaddr &src)
{
int64_t n = 0;
int64_t n2 = 0;
switch (src.sa_family) {
case AF_INET:
n = sizeof(sockaddr_in);
Expand All @@ -577,20 +576,7 @@ inline bool ops_ip_copy(sockaddr &dst, const sockaddr &src)
case AF_UNIX:
break;
}
switch (dst.sa_family) {
case AF_INET:
n2 = sizeof(sockaddr_in);
break;

case AF_INET6:
n2 = sizeof(sockaddr_in6);
break;

default:
n2 = sizeof(sockaddr_in);
break;
}
if (n && n <= n2) {
if (n) {
MEMCPY(&dst, &src, n);
#if HAVE_STRUCT_SOCKADDR_SA_LEN
dst.sa_len = n;
Expand Down

0 comments on commit 81eeae9

Please sign in to comment.