From b3325144f856c29a7d89bc558fab3fc01a53c5b1 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 13 Mar 2019 12:44:35 +0100 Subject: [PATCH] Fixed new IPv6 range code for platforms without s6_addr32 component --- CHANGES | 2 ++ test.sh | 2 +- xio-ip6.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3c381ef..c63be97 100644 --- a/CHANGES +++ b/CHANGES @@ -85,6 +85,8 @@ Porting: Related Gentoo bug 426262: Warning on configure.in Thanks to Francesco Turco for reporting that warning. + Fixed new IPv6 range code for platforms without s6_addr32 component. + Testing: test.sh: Show a warning when phase-1 (insecure phase) of a security test fails diff --git a/test.sh b/test.sh index 961171d..0814927 100755 --- a/test.sh +++ b/test.sh @@ -6865,7 +6865,7 @@ case "$TESTS" in TEST="$NAME: TCP4 mapped into TCP6 address space" if ! eval $NUMCOND; then :; elif true; then - $PRINTF "test $F_n $TEST... ${YELLOW}Feature reoved${NORMAL}\n" $N + $PRINTF "test $F_n $TEST... ${YELLOW}Feature removed${NORMAL}\n" $N elif ! testaddrs tcp ip6 >/dev/null || ! runsip6 >/dev/null; then $PRINTF "test $F_n $TEST... ${YELLOW}TCP6 not available${NORMAL}\n" $N numCANT=$((numCANT+1)) diff --git a/xio-ip6.c b/xio-ip6.c index ac272bd..e051797 100644 --- a/xio-ip6.c +++ b/xio-ip6.c @@ -190,7 +190,7 @@ int xiocheckrange_ip6(struct sockaddr_in6 *pa, struct xiorange *range) { sockaddr_inet6_info(pa, peername, sizeof(peername))); for (i = 0; i < 4; ++i) { - masked.u6_addr32[i] = pa->sin6_addr.s6_addr32[i] & rangemask->u6_addr32[i]; + masked.u6_addr32[i] = ((union xioin6_u *)&pa->sin6_addr.s6_addr[0])->u6_addr32[i] & rangemask->u6_addr32[i]; } Debug8("masked address is [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", htons(masked.u6_addr16[0]), htons(masked.u6_addr16[1]),