summaryrefslogtreecommitdiffstats
path: root/qarsh.c
diff options
context:
space:
mode:
authorDean Jansa <djansa@redhat.com>2010-09-28 15:53:28 -0500
committerDean Jansa <djansa@redhat.com>2010-09-28 15:53:28 -0500
commitedf6032e3395baa5e2a160e4f70d3b108ae31622 (patch)
tree583c4dccccd249674adb9711b083a5597d3405ac /qarsh.c
parente96e56146dc7c11d388d25db42383993b87e8791 (diff)
downloadqarsh-edf6032e3395baa5e2a160e4f70d3b108ae31622.tar.gz
qarsh-edf6032e3395baa5e2a160e4f70d3b108ae31622.tar.xz
qarsh-edf6032e3395baa5e2a160e4f70d3b108ae31622.zip
First crack at ipv6/ipv4 agnostic qarsh/qacp.
Diffstat (limited to 'qarsh.c')
-rw-r--r--qarsh.c9
1 files changed, 5 insertions, 4 deletions
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) {