Changeset 46765 in vbox
- Timestamp:
- Jun 24, 2013 8:17:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c
r46758 r46765 27 27 #define isdigit(ch) RT_C_IS_DIGIT(ch) 28 28 #define isalpha(ch) RT_C_IS_ALPHA(ch) 29 30 29 31 30 #define DNS_CONTROL_PORT_NUMBER 53 … … 198 197 /* Parse dns request */ 199 198 char *qw_qname = 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 199 struct hostent *pHostent = NULL; 208 200 char pszCname[255]; 209 201 int cname_len = 0; … … 253 245 pszCname[cname_len - 2] = 0; 254 246 } 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; 247 pHostent = gethostbyname(pszCname); 266 248 #ifdef VBOX_WITH_DNSMAPPING_IN_HOSTRESOLVER 267 249 if ( pHostent
Note:
See TracChangeset
for help on using the changeset viewer.