Changeset 46758 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Jun 24, 2013 3:44:55 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86686
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c
r44529 r46758 27 27 #define isdigit(ch) RT_C_IS_DIGIT(ch) 28 28 #define isalpha(ch) RT_C_IS_ALPHA(ch) 29 29 30 30 31 #define DNS_CONTROL_PORT_NUMBER 53 … … 197 198 /* Parse dns request */ 198 199 char *qw_qname = NULL; 199 struct hostent *pHostent = NULL; 200 struct { 201 struct hostent hostnt; 202 char buffer[1024]; 203 } hostent_with_buffer; 204 struct hostent *pHostent = &hostent_with_buffer.hostnt; 205 int rc_hostent = 0; 206 int h_errnop = 0; 207 200 208 char pszCname[255]; 201 209 int cname_len = 0; … … 245 253 pszCname[cname_len - 2] = 0; 246 254 } 247 pHostent = gethostbyname(pszCname); 255 rc_hostent = gethostbyname_r(pszCname, 256 &hostent_with_buffer.hostnt, 257 hostent_with_buffer.buffer, 258 1024, 259 &pHostent, 260 &h_errnop); 261 /* Expected rc_hostent equals to 0, if not 0 and h_errnop == ERANGE 262 * we need to alloc more memory, for buffer. 263 */ 264 if (rc_hostent) 265 return 1; 248 266 #ifdef VBOX_WITH_DNSMAPPING_IN_HOSTRESOLVER 249 267 if ( pHostent
Note:
See TracChangeset
for help on using the changeset viewer.