Improve getservbyname and getservbyport (#207)

- support aliases in /etc/services
- use case insensitive comparisons
- add tests
This commit is contained in:
Gautham 2021-07-06 00:55:26 +05:30 committed by GitHub
parent 58fb2fb3d3
commit c0bec24fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 202 additions and 58 deletions

View file

@ -31,9 +31,9 @@
struct hostent *gethostbyaddr(const void *s_addr, socklen_t len, int type) {
static struct hostent *ptr1, he1;
static char h_name[DNS_NAME_MAX+1];
static char* h_aliases[1];
static char* h_addr_list[2];
static char h_name[DNS_NAME_MAX + 1];
static char *h_aliases[1];
static char *h_addr_list[2];
static char h_addr_list0[4];
struct sockaddr_in addr;