From ec48e04cd5a4cba890bd7959a94177ad0907b31a Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 11 Feb 2023 23:36:56 +0100 Subject: [PATCH] PinholeVerification(): use memcpy() to compare structures fix 99fc9941aa301323307a865f3798f64d189cc544 --- miniupnpd/upnpsoap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniupnpd/upnpsoap.c b/miniupnpd/upnpsoap.c index f1d0d2f..2407b6e 100644 --- a/miniupnpd/upnpsoap.c +++ b/miniupnpd/upnpsoap.c @@ -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);