PinholeVerification(): use memcpy() to compare structures

fix 99fc9941aa
This commit is contained in:
Thomas Bernard 2023-02-11 23:36:56 +01:00
parent 99fc9941aa
commit ec48e04cd5
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 1 additions and 1 deletions

View File

@ -1634,7 +1634,7 @@ PinholeVerification(struct upnphttp * h, char * int_ip, unsigned short int_port)
strncpy(clientaddr_str, "*ERROR*", sizeof(clientaddr_str));
}
if(h->clientaddr_v6.s6_addr != result_ip.s6_addr)
if(memcmp(&h->clientaddr_v6, &result_ip, sizeof(struct in6_addr)) != 0)
{
syslog(LOG_INFO, "%s: Client %s tried to access pinhole for internal %s and is not authorized",
"PinholeVerification", clientaddr_str, int_ip);