gethostbyaddr hook: also set aliases.
i inspected behaviour of libc's and they all seem to set a valid h_aliases pointer, of which the first one should be NULL, if no aliases exist.pull/18/head
parent
859dabb302
commit
e8d49b02e8
|
@ -400,6 +400,7 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
|
|||
static char buf[16];
|
||||
static char ipv4[4];
|
||||
static char *list[2];
|
||||
static char *aliases[1];
|
||||
static struct hostent he;
|
||||
|
||||
INIT();
|
||||
|
@ -419,7 +420,8 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) {
|
|||
list[1] = NULL;
|
||||
he.h_addr_list = list;
|
||||
he.h_addrtype = AF_INET;
|
||||
he.h_aliases = NULL;
|
||||
aliases[0] = NULL;
|
||||
he.h_aliases = aliases;
|
||||
he.h_length = 4;
|
||||
pc_stringfromipv4((unsigned char *) addr, buf);
|
||||
return &he;
|
||||
|
|
Loading…
Reference in New Issue