VirtualBox

Changeset 17982 in vbox


Ignore:
Timestamp:
Mar 16, 2009 9:42:49 PM (16 years ago)
Author:
vboxsync
Message:

Empty address handling + darwin fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/netif.h

    r17981 r17982  
    8888DECLINLINE(Bstr) composeIPv6Address(PRTNETADDRIPV6 aAddrPtr)
    8989{
    90     char szTmp[8*5];
     90    char szTmp[8*5] = "";
    9191
    92     RTStrPrintf(szTmp, sizeof(szTmp),
    93                 "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
    94                 "%02x%02x:%02x%02x:%02x%02x:%02x%02x",
    95                 aAddrPtr->au8[0], aAddrPtr->au8[1],
    96                 aAddrPtr->au8[2], aAddrPtr->au8[3],
    97                 aAddrPtr->au8[4], aAddrPtr->au8[5],
    98                 aAddrPtr->au8[6], aAddrPtr->au8[7],
    99                 aAddrPtr->au8[8], aAddrPtr->au8[9],
    100                 aAddrPtr->au8[10], aAddrPtr->au8[11],
    101                 aAddrPtr->au8[12], aAddrPtr->au8[13],
    102                 aAddrPtr->au8[14], aAddrPtr->au8[15]);
     92    if (aAddrPtr->s.Lo || aAddrPtr->s.Hi)
     93        RTStrPrintf(szTmp, sizeof(szTmp),
     94                    "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
     95                    "%02x%02x:%02x%02x:%02x%02x:%02x%02x",
     96                    aAddrPtr->au8[0], aAddrPtr->au8[1],
     97                    aAddrPtr->au8[2], aAddrPtr->au8[3],
     98                    aAddrPtr->au8[4], aAddrPtr->au8[5],
     99                    aAddrPtr->au8[6], aAddrPtr->au8[7],
     100                    aAddrPtr->au8[8], aAddrPtr->au8[9],
     101                    aAddrPtr->au8[10], aAddrPtr->au8[11],
     102                    aAddrPtr->au8[12], aAddrPtr->au8[13],
     103                    aAddrPtr->au8[14], aAddrPtr->au8[15]);
    103104    return Bstr(szTmp);
    104105}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette