Merge pull request #701 from anhu/ipv6_fix

Fix compile error triggered by enabling TEST_IPV6
pull/702/head
David Garske 2024-05-28 09:43:21 -07:00 committed by GitHub
commit 11f0b22a0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -2396,8 +2396,13 @@ static int StartSSHD(int argc, char** argv)
conn->fd = (int)accept(listenFd, (struct sockaddr*)&clientAddr, conn->fd = (int)accept(listenFd, (struct sockaddr*)&clientAddr,
&clientAddrSz); &clientAddrSz);
if (conn->fd >= 0) { if (conn->fd >= 0) {
inet_ntop(AF_INET, &clientAddr.sin_addr, conn->ip, inet_ntop(AF_INET,
INET_ADDRSTRLEN); #ifdef TEST_IPV6
&clientAddr.sin6_addr,
#else
&clientAddr.sin_addr,
#endif /* TEST_IPV6 */
conn->ip, INET_ADDRSTRLEN);
} }
#endif #endif