We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0209363 commit e91311eCopy full SHA for e91311e
ip_addr.h
@@ -366,6 +366,11 @@ static inline int hostent2su( struct sockaddr_union_struct* su,
366
unsigned short port )
367
{
368
memset(su, 0, sizeof(struct sockaddr_union_struct)); /*needed on freebsd*/
369
+
370
+ /* copy the hostname into the sockaddr_union_struct */
371
+ strncpy(su->hostname, he->h_name, sizeof(su->hostname)-1);
372
+ su->hostname[sizeof(su->hostname)-1] = 0;
373
374
su->u.s.sa_family=he->h_addrtype;
375
switch(he->h_addrtype){
376
case AF_INET6:
0 commit comments