Fixed new IPv6 range code for platforms without s6_addr32 component

This commit is contained in:
Gerhard Rieger 2019-03-13 12:44:35 +01:00
parent ba27f6c3ba
commit b3325144f8
3 changed files with 4 additions and 2 deletions

View file

@ -85,6 +85,8 @@ Porting:
Related Gentoo bug 426262: Warning on configure.in Related Gentoo bug 426262: Warning on configure.in
Thanks to Francesco Turco for reporting that warning. Thanks to Francesco Turco for reporting that warning.
Fixed new IPv6 range code for platforms without s6_addr32 component.
Testing: Testing:
test.sh: Show a warning when phase-1 (insecure phase) of a security test.sh: Show a warning when phase-1 (insecure phase) of a security
test fails test fails

View file

@ -6865,7 +6865,7 @@ case "$TESTS" in
TEST="$NAME: TCP4 mapped into TCP6 address space" TEST="$NAME: TCP4 mapped into TCP6 address space"
if ! eval $NUMCOND; then :; if ! eval $NUMCOND; then :;
elif true; 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 elif ! testaddrs tcp ip6 >/dev/null || ! runsip6 >/dev/null; then
$PRINTF "test $F_n $TEST... ${YELLOW}TCP6 not available${NORMAL}\n" $N $PRINTF "test $F_n $TEST... ${YELLOW}TCP6 not available${NORMAL}\n" $N
numCANT=$((numCANT+1)) numCANT=$((numCANT+1))

View file

@ -190,7 +190,7 @@ int xiocheckrange_ip6(struct sockaddr_in6 *pa, struct xiorange *range) {
sockaddr_inet6_info(pa, peername, sizeof(peername))); sockaddr_inet6_info(pa, peername, sizeof(peername)));
for (i = 0; i < 4; ++i) { 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]", Debug8("masked address is [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]",
htons(masked.u6_addr16[0]), htons(masked.u6_addr16[1]), htons(masked.u6_addr16[0]), htons(masked.u6_addr16[1]),