Opened 3 weeks ago

Last modified 3 weeks ago

#19296 new bug

Review IPv6 IsEmpty parsing of BNetworkAddress — at Initial Version

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

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;
}

Setting :: as the IPv6 address gets IsEmpty true. Setting 100::1 as the IPv6 address

Change History (0)

Note: See TracTickets for help on using tickets.