From edf6032e3395baa5e2a160e4f70d3b108ae31622 Mon Sep 17 00:00:00 2001 From: Dean Jansa Date: Tue, 28 Sep 2010 15:53:28 -0500 Subject: First crack at ipv6/ipv4 agnostic qarsh/qacp. --- qarsh.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'qarsh.c') diff --git a/qarsh.c b/qarsh.c index 6575bd0..116779d 100644 --- a/qarsh.c +++ b/qarsh.c @@ -50,6 +50,7 @@ /* Globals */ int qarsh_fd = -1; /* The control connection to qarshd */ +unsigned short qarsh_ss_family; /* AF_INET/AF_INET6, set on connect */ hbeat_t qarsh_hb; /* Heartbeat handle */ int signal_to_send = 0; int sigs_to_propogate[] = { SIGINT, SIGTERM, SIGHUP, SIGUSR1, SIGUSR2 }; @@ -191,11 +192,11 @@ run_remote_cmd(char *cmdline) struct timespec timeout; short cmd_finished; - l_in = bind_any(QARSH_MINPORT); + l_in = bind_any(QARSH_MINPORT, qarsh_ss_family); p_in = getsockport(l_in); - l_out = bind_any(QARSH_MINPORT); + l_out = bind_any(QARSH_MINPORT, qarsh_ss_family); p_out = getsockport(l_out); - l_err = bind_any(QARSH_MINPORT); + l_err = bind_any(QARSH_MINPORT, qarsh_ss_family); p_err = getsockport(l_err); qp = make_qp_runcmd(cmdline, p_in, p_out, p_err); @@ -508,7 +509,7 @@ again: sigaction(SIGALRM, &sa, NULL); alarm(max_timeout); - qarsh_fd = connect_to_host(host, port); + qarsh_fd = connect_to_host(host, port, &qarsh_ss_family); alarm(0); if (qarsh_fd == -1) { -- cgit