]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
network: Fix calculating the last IP address of a network
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 18:56:00 +0000 (18:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 18:56:00 +0000 (18:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network.c

index 77425e6efe03cba5f4e46c7c4fccb361a91738ec..b19a65af2e6661441b8c90e31c892f10eae62ee8 100644 (file)
@@ -86,7 +86,7 @@ static struct in6_addr make_last_address(const struct in6_addr* address, unsigne
 
        // Perform bitwise OR
        for (unsigned int i = 0; i < 4; i++)
-               a.s6_addr32[i] = address->s6_addr[i] | ~bitmask.s6_addr32[i];
+               a.s6_addr32[i] = address->s6_addr32[i] | ~bitmask.s6_addr32[i];
 
        return a;
 }