Changeset 15456 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 14, 2008 10:28:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/solaris/NetIfList-solaris.cpp
r15455 r15456 118 118 RTStrPrintf(szNICDesc, sizeof(szNICDesc), "%s - Ethernet", szNICInstance); 119 119 120 /* 121 * Try to get IP V4 address and netmask as well as Ethernet address. 122 */ 120 123 NETIFINFO Info; 121 124 memset(&Info, 0, sizeof(Info)); … … 156 159 close(Sock); 157 160 } 161 /* 162 * Try to get IP V6 address and netmask. 163 */ 164 Sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP); 165 if (Sock > 0) 166 { 167 struct lifreq IfReq; 168 strcpy(IfReq.lifr_name, szNICInstance); if (ioctl(Sock, SIOCGLIFADDR, &IfReq) >= 0) 169 { 170 memcpy(Info.IPv6Address.au8, ((struct sockaddr_in6 *)&IfReq.lifr_addr)->sin6_addr.s6_addr, 171 sizeof(Info.IPv6Address.au8)); 172 } 173 if (ioctl(Sock, SIOCGLIFNETMASK, &IfReq) >= 0) 174 { 175 memcpy(Info.IPv6NetMask.au8, ((struct sockaddr_in6 *)&IfReq.lifr_addr)->sin6_addr.s6_addr, 176 sizeof(Info.IPv6NetMask.au8)); 177 } 178 close(Sock); 179 } 180 158 181 /* 159 182 * Construct UUID with interface name and the MAC address if available.
Note:
See TracChangeset
for help on using the changeset viewer.