Subject: Re: bin/1067: ifconfig uses inet_addr rather than inet_aton
To: None <netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-bugs
Date: 05/19/1995 21:25:24
> >Fix:
> Use inet_aton() instead of inet_addr (deprecated).
Fine...but...
> ! if (inet_aton(s, (struct in_addr*)&sin->sin_addr.s_addr)==0)
> ! if (hp = gethostbyname(s))
> memcpy(&sin->sin_addr, hp->h_addr, hp->h_length);
Argh! Why take a perfectly good struct in_addr, take one of its
members, and cast a pointer to that member back to a pointer to the
structure type? Why in the world not just
if (inet_aton(s, &sin->sin_addr) == 0)
der Mouse
mouse@collatz.mcrcim.mcgill.edu