Use in_addr_t for the right size of an IPv4 address, and copy into
an unaligned destination using bcopy instead of an assignment. Submitted by: Hartmut Brandt <brandt@fokus.gmd.de> PR: sparc64/46729
This commit is contained in:
parent
2b0e597682
commit
a6497df52c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108711
@ -67,6 +67,7 @@ _gethostbynis(name, map, af)
|
||||
static struct hostent h;
|
||||
static char *domain = (char *)NULL;
|
||||
static char ypbuf[YPMAXRECORD + 2];
|
||||
in_addr_t addr;
|
||||
|
||||
switch(af) {
|
||||
case AF_INET:
|
||||
@ -104,7 +105,8 @@ _gethostbynis(name, map, af)
|
||||
*cp++ = '\0';
|
||||
h.h_addr_list = host_addrs;
|
||||
h.h_addr = hostaddr;
|
||||
*((u_long *)h.h_addr) = inet_addr(result);
|
||||
addr = inet_addr(result);
|
||||
bcopy((char *)&addr, h.h_addr, size);
|
||||
h.h_length = size;
|
||||
h.h_addrtype = AF_INET;
|
||||
while (*cp == ' ' || *cp == '\t')
|
||||
|
Loading…
Reference in New Issue
Block a user