mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
human_addr2(): only attempt to parse INET addresses
This commit is contained in:
@@ -40,6 +40,10 @@ char *human_addr2(const struct sockaddr *sa, socklen_t salen,
|
||||
if (!buf || !buflen)
|
||||
return NULL;
|
||||
|
||||
if (sa->sa_family != AF_INET && sa->sa_family != AF_INET6) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (full != 0 && salen == sizeof(struct sockaddr_in6) &&
|
||||
((struct sockaddr_in6*)sa)->sin6_port != 0) {
|
||||
*buf = '[';
|
||||
|
||||
Reference in New Issue
Block a user