Changeset 14471 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 21, 2008 4:07:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/misc.c
r14470 r14471 29 29 getouraddr(PNATState pData) 30 30 { 31 char buff[256]; 32 struct hostent *he = NULL; 33 34 if (gethostname(buff,256) == 0) 35 { 36 he = gethostbyname(buff); 37 if (he) 38 { 39 uint32_t ipv4_addr; 40 ipv4_addr = ntohl((*(struct in_addr*)he->h_addr).s_addr); 41 LogRel(("NAT: host is '%s' => %u.%u.%u.%u\n", 42 buff, 43 ipv4_addr >> 24, (ipv4_addr >> 16) & 0xff, 44 (ipv4_addr >> 8) & 0xff, ipv4_addr & 0xff)); 45 } 46 else 47 LogRel(("NAT: host name is '%s' (using 127.0.0.1)\n", buff)); 48 } 49 if (he) 50 our_addr = *(struct in_addr *)he->h_addr; 51 if (our_addr.s_addr == 0) 52 our_addr.s_addr = loopback_addr.s_addr; 31 our_addr.s_addr = loopback_addr.s_addr; 53 32 } 54 33
Note:
See TracChangeset
for help on using the changeset viewer.