Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
socket activation: saner IPv6 address comparison when looking for a m…
…atching descriptor
  • Loading branch information
tsmetana authored and perexg committed Sep 4, 2015
1 parent 5079891 commit af643fa
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/tcp.c
Expand Up @@ -779,19 +779,6 @@ tcp_server_create
}

#if ENABLE_LIBSYSTEMD_DAEMON

inline static int
ip6_addr_cmp(unsigned char a1[16], unsigned char a2[16])
{
int i;
int ret = 0;

for (i = 0; i < 16 && !ret; i++)
if (a1[i] != a2[i])
ret = 1;
return ret;
}

/**
*
*/
Expand Down Expand Up @@ -833,7 +820,7 @@ tcp_server_create
break;
case AF_INET6:
s_addr6 = (struct sockaddr_in6 *) &bound;
if (ip6_addr_cmp(addr6.s6_addr, s_addr6->sin6_addr.s6_addr) == 0
if (memcmp(addr6.s6_addr, s_addr6->sin6_addr.s6_addr, 16) == 0
&& htons(port) == s_addr6->sin6_port)
found = 1;
break;
Expand Down

0 comments on commit af643fa

Please sign in to comment.