+static int aton(struct thread_data *td, const char *host,
+ struct sockaddr_in *addr)
+{
+ if (inet_aton(host, &addr->sin_addr) != 1) {
+ struct hostent *hent;
+
+ hent = gethostbyname(host);
+ if (!hent) {
+ td_verror(td, errno, "gethostbyname");
+ return 1;
+ }
+
+ memcpy(&addr->sin_addr, hent->h_addr, 4);
+ }
+ return 0;
+}
+