aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libntp/sockaddrtest.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2020-06-24 00:20:45 +0000
committerCy Schubert <cy@FreeBSD.org>2020-06-24 00:20:45 +0000
commit3914721463f70500ecc1f59312b122d8788465cf (patch)
treef253e72838d762e229ca71912a4a928e96cac2bd /tests/libntp/sockaddrtest.c
parent5171bc9b11192d9ad273db7854787eaa65eb9997 (diff)
downloadsrc-vendor/ntp.tar.gz
src-vendor/ntp.zip
Import ntp-4.2.8p15.vendor/ntp/4.2.8p15vendor/ntp
Security: ntp bug 3661
Notes
Notes: svn path=/vendor/ntp/dist/; revision=362565 svn path=/vendor/ntp/4.2.8p15/; revision=362566; tag=vendor/ntp/4.2.8p15
Diffstat (limited to 'tests/libntp/sockaddrtest.c')
-rw-r--r--tests/libntp/sockaddrtest.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/libntp/sockaddrtest.c b/tests/libntp/sockaddrtest.c
index bbf669c78487..5a37fab56fea 100644
--- a/tests/libntp/sockaddrtest.c
+++ b/tests/libntp/sockaddrtest.c
@@ -26,9 +26,9 @@ IsEqual(const sockaddr_u expected, const sockaddr_u actual) {
}
if (actual.sa.sa_family == AF_INET) { // IPv4
- if (expected.sa4.sin_port == actual.sa4.sin_port &&
- memcmp(&expected.sa4.sin_addr, &actual.sa4.sin_addr,
- sizeof( in )) == 0) {
+ if ( expected.sa4.sin_port == actual.sa4.sin_port
+ && memcmp(&expected.sa4.sin_addr, &actual.sa4.sin_addr,
+ sizeof( in )) == 0) {
return TRUE;
} else {
char buf[4][32];
@@ -41,9 +41,10 @@ IsEqual(const sockaddr_u expected, const sockaddr_u actual) {
return FALSE;
}
} else if (actual.sa.sa_family == AF_INET6) { //IPv6
- if (expected.sa6.sin6_port == actual.sa6.sin6_port &&
- memcmp(&expected.sa6.sin6_addr, &actual.sa6.sin6_addr,
- sizeof(in6)) == 0) {
+ if ( expected.sa6.sin6_port == actual.sa6.sin6_port
+ && expected.sa6.sin6_scope_id == actual.sa6.sin6_scope_id
+ && memcmp(&expected.sa6.sin6_addr, &actual.sa6.sin6_addr,
+ sizeof(in6)) == 0) {
return TRUE;
} else {
printf("IPv6 comparision failed");