Opened 9 years ago

Closed 8 years ago

#12246 closed bug (duplicate)

BNetworkAddress IsLocal false when SetTo "::1" IPv6 address

Reported by: kallisti5 Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Kits/Network Kit Version: R1/Development
Keywords: ipv6 bunittest bnetlib Cc:
Blocked By: Blocking:
Platform: All

Description

BNetworkAddress v4Address("127.0.0.1");
BNetworkAddress v6Address("::1");

ASSERT_TRUE(v4Address.IsLocal()); // PASS
ASSERT_TRUE(v6Address.IsLocal()); // FAIL

Change History (3)

comment:1 by kallisti5, 9 years ago

Resolution: invalid
Status: newclosed

This is actually invalid.

I assumed IsLocal simply looked for ::1 or 127.0.0.1 like IsBroadcast, IsMulticast, etc. However IsLocal looks to see if the address is assigned to an interface on the system.

comment:2 by kallisti5, 9 years ago

Resolution: invalid
Status: closedreopened

Actually, this is broken. IsLocal for ::1 results in a failed match even though it is assigned to loop.

My unit tests show BNetworkAddress Equals is broken for IPv6, and IsLocal uses Equals... so that is likely the cause.

comment:3 by kallisti5, 8 years ago

Resolution: duplicate
Status: reopenedclosed

Actually, this is duplicate of #12247 ;-)

Setting IPv6 addresses to BNetworkAddress fail.

Note: See TracTickets for help on using tickets.