Opened 5 weeks ago
Last modified 5 weeks ago
#19296 new bug
Review IPv6 IsEmpty parsing of BNetworkAddress
Reported by: | kallisti5 | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Network & Internet/IPv6 | Version: | R1/beta5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
While the BNetworkAddress object properly detects an empty IPv4 address. (0.0.0.0 .IsEmpty() == true), it appears BNetworkAddress may not properly detect an empty IPv6 address.
Test Code:
// g++ test.cpp -lnetwork -lbe -lroot -lbnetapi #include <stdio.h> #include <NetworkAddress.h> int main() { BNetworkAddress address; address.SetTo(AF_INET6, "::"); printf(":: Address Is Empty: %s\n", address.IsEmpty() ? "true" : "false"); address.SetTo(AF_INET6, "dead::beef"); printf("dead::beef Address Is Empty: %s\n", address.IsEmpty() ? "true" : "false"); address.SetTo(AF_INET, "0.0.0.0"); printf("0.0.0.0 Address Is Empty: %s\n", address.IsEmpty() ? "true" : "false"); address.SetTo(AF_INET, "10.0.0.0"); printf("10.0.0.0 Address Is Empty: %s\n", address.IsEmpty() ? "true" : "false"); return 0; }
./a.out :: Address Is Empty: true dead::beef Address Is Empty: true 0.0.0.0 Address Is Empty: true 10.0.0.0 Address Is Empty: false
:: should be Empty. dead::beef should not be.
Change History (2)
comment:1 by , 5 weeks ago
Description: | modified (diff) |
---|
comment:2 by , 5 weeks ago
Note:
See TracTickets
for help on using tickets.
What does SetTo() return here?
Ultimately this goes down to the resolver in libnetwork.