Changeset 15455 in vbox for trunk/src/VBox/Main/solaris
- Timestamp:
- Dec 14, 2008 9:58:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/solaris/NetIfList-solaris.cpp
r15446 r15455 40 40 #include <list> 41 41 42 #include "Logging.h" 42 43 #include "HostNetworkInterfaceImpl.h" 43 44 #include "netif.h" … … 126 127 if (ioctl(Sock, SIOCGLIFADDR, &IfReq) >= 0) 127 128 { 128 memcpy(Info.IPAddress.au8, ((struct sockaddr *)&IfReq.lifr_addr)->sa_data,129 memcpy(Info.IPAddress.au8, &((struct sockaddr_in *)&IfReq.lifr_addr)->sin_addr.s_addr, 129 130 sizeof(Info.IPAddress.au8)); 130 // SIOCGLIFNETMASK131 131 struct arpreq ArpReq; 132 132 memcpy(&ArpReq.arp_pa, &IfReq.lifr_addr, sizeof(struct sockaddr_in)); … … 139 139 */ 140 140 if (ioctl(Sock, SIOCGARP, &ArpReq) >= 0) 141 { 141 142 memcpy(&Info.MACAddress, ArpReq.arp_ha.sa_data, sizeof(Info.MACAddress)); 143 } 142 144 143 145 } … … 145 147 if (ioctl(Sock, SIOCGLIFNETMASK, &IfReq) >= 0) 146 148 { 147 memcpy(Info.IPNetMask.au8, ((struct sockaddr *)&IfReq.lifr_addr)->sa_data,149 memcpy(Info.IPNetMask.au8, &((struct sockaddr_in *)&IfReq.lifr_addr)->sin_addr.s_addr, 148 150 sizeof(Info.IPNetMask.au8)); 149 151 } … … 169 171 Uuid.Gen.au8Node[5] = Info.MACAddress.au8[5]; 170 172 Info.Uuid = Uuid; 173 Info.enmType = NETIF_T_ETHERNET; 171 174 172 175 ComObjPtr<HostNetworkInterface> IfObj; 173 176 IfObj.createObject(); 174 if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), Guid(Uuid))))177 if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), &Info))) 175 178 pList->push_back(IfObj); 176 179 }
Note:
See TracChangeset
for help on using the changeset viewer.