add x to IPv6 functions which can die

This commit is contained in:
Denis Vlasenko
2007-02-04 02:39:08 +00:00
parent 45854b5e3f
commit 42823d597a
10 changed files with 37 additions and 36 deletions

View File

@@ -307,7 +307,7 @@ int arping_main(int argc, char **argv)
if (!inet_aton(target, &dst)) {
len_and_sockaddr *lsa;
lsa = host_and_af2sockaddr(target, 0, AF_INET);
lsa = xhost_and_af2sockaddr(target, 0, AF_INET);
memcpy(&dst, &lsa->sin.sin_addr.s_addr, 4);
if (ENABLE_FEATURE_CLEAN_UP)
free(lsa);

View File

@@ -377,7 +377,7 @@ int dnsd_main(int argc, char **argv)
signal(SIGURG, SIG_IGN);
#endif
lsa = host2sockaddr(listen_interface, port);
lsa = xhost2sockaddr(listen_interface, port);
udps = xsocket(lsa->sa.sa_family, SOCK_DGRAM, 0);
xbind(udps, &lsa->sa, lsa->len);
// xlisten(udps, 50); - ?!! DGRAM sockets are never listened on I think?

View File

@@ -346,7 +346,7 @@ int ftpgetput_main(int argc, char **argv)
/* We want to do exactly _one_ DNS lookup, since some
* sites (i.e. ftp.us.debian.org) use round-robin DNS
* and we want to connect to only one IP... */
server->lsa = host2sockaddr(argv[0], bb_lookup_port(port, "tcp", 21));
server->lsa = xhost2sockaddr(argv[0], bb_lookup_port(port, "tcp", 21));
if (verbose_flag) {
printf("Connecting to %s (%s)\n", argv[0],
xmalloc_sockaddr2dotted(&server->lsa->sa, server->lsa->len));

View File

@@ -49,7 +49,7 @@
static int print_host(const char *hostname, const char *header)
{
/* We can't use host2sockaddr() - we want to get ALL addresses,
/* We can't use xhost2sockaddr() - we want to get ALL addresses,
* not just one */
struct addrinfo *result = NULL;

View File

@@ -211,9 +211,9 @@ int ping_main(int argc, char **argv)
bb_show_usage();
#if ENABLE_PING6
lsa = host_and_af2sockaddr(hostname, 0, af);
lsa = xhost_and_af2sockaddr(hostname, 0, af);
#else
lsa = host_and_af2sockaddr(hostname, 0, AF_INET);
lsa = xhost_and_af2sockaddr(hostname, 0, AF_INET);
#endif
/* Set timer _after_ DNS resolution */
signal(SIGALRM, noresp);
@@ -743,9 +743,9 @@ int ping_main(int argc, char **argv)
af = AF_INET;
if (option_mask32 & OPT_IPV6)
af = AF_INET6;
lsa = host_and_af2sockaddr(hostname, 0, af);
lsa = xhost_and_af2sockaddr(hostname, 0, af);
#else
lsa = host_and_af2sockaddr(hostname, 0, AF_INET);
lsa = xhost_and_af2sockaddr(hostname, 0, AF_INET);
#endif
dotted = xmalloc_sockaddr2dotted_noport(&lsa->sa, lsa->len);
#if ENABLE_PING6

View File

@@ -488,7 +488,7 @@ int tftp_main(int argc, char **argv)
}
port = bb_lookup_port(argv[optind + 1], "udp", 69);
peer_lsa = host2sockaddr(argv[optind], port);
peer_lsa = xhost2sockaddr(argv[optind], port);
#if ENABLE_DEBUG_TFTP
fprintf(stderr, "using server \"%s\", "

View File

@@ -234,7 +234,7 @@ int wget_main(int argc, char **argv)
/* We want to do exactly _one_ DNS lookup, since some
* sites (i.e. ftp.us.debian.org) use round-robin DNS
* and we want to connect to only one IP... */
lsa = host2sockaddr(server.host, server.port);
lsa = xhost2sockaddr(server.host, server.port);
if (!(opt & WGET_OPT_QUIET)) {
fprintf(stderr, "Connecting to %s (%s)\n", server.host,
xmalloc_sockaddr2dotted(&lsa->sa, lsa->len));
@@ -354,7 +354,7 @@ int wget_main(int argc, char **argv)
server.port = target.port;
}
free(lsa);
lsa = host2sockaddr(server.host, server.port);
lsa = xhost2sockaddr(server.host, server.port);
break;
}
}