My man says that both
So i decided to change them to getaddrinfo. So i tried to runThe gethostbyname*() and gethostbyaddr*() functions are obsolete.
where host="184.108.40.206" andCode:l_error=getaddrinfo(host, NULL, NULL, ServerSocketAddresses);
static struct addrinfo **ServerSocketAddresses=NULL;
From documentation it seems that every parameter under rule and memory for ServerSocketAddresses supposed to be allocated inside call (that's why we have freeaddrinfo for later...)Breakpoint 1, set_server_info (host=0x7fffffffe38e "220.127.116.11", port=80, addr_len=0x7fffffffdf1c) at socket_ip_client.c:38
38 l_error=getaddrinfo(host, NULL, NULL, ServerSocketAddresses);
(gdb) p host
$1 = 0x7fffffffe38e "18.104.22.168"
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ae9d1a in getaddrinfo () from /lib/x86_64-linux-gnu/libc.so.6
Am i doing smth wrong or glibc does so?