summaryrefslogtreecommitdiffstats
path: root/usr.sbin/relayctl
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2011-05-20 09:43:53 +0000
committerreyk <reyk@openbsd.org>2011-05-20 09:43:53 +0000
commit86b74329110804116a3a6479d388f02cf7434a82 (patch)
treed4b6220b2727d6b0d41c7a5f177d342618651ac3 /usr.sbin/relayctl
parentFix typo; from Brad (diff)
downloadwireguard-openbsd-86b74329110804116a3a6479d388f02cf7434a82.tar.xz
wireguard-openbsd-86b74329110804116a3a6479d388f02cf7434a82.zip
Concurrent calls of "relayctl show sessions" could crash relayd. Fix
the show sessions handler by implementing it in an asynchronous way. Closes PR 6509 ok pyr@
Diffstat (limited to 'usr.sbin/relayctl')
-rw-r--r--usr.sbin/relayctl/relayctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/relayctl/relayctl.c b/usr.sbin/relayctl/relayctl.c
index 1f83e8109ad..382f9551d84 100644
--- a/usr.sbin/relayctl/relayctl.c
+++ b/usr.sbin/relayctl/relayctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayctl.c,v 1.44 2011/05/19 08:56:49 reyk Exp $ */
+/* $OpenBSD: relayctl.c,v 1.45 2011/05/20 09:43:53 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -447,7 +447,8 @@ show_session_msg(struct imsg *imsg)
fatal("show_session_msg: gettimeofday");
print_time(&tv_now, &con->se_tv_start, a, sizeof(a));
print_time(&tv_now, &con->se_tv_last, b, sizeof(b));
- printf("\tage %s, idle %s, relay %u", a, b, con->se_relayid);
+ printf("\tage %s, idle %s, relay %u, pid %u",
+ a, b, con->se_relayid, con->se_pid);
if (con->se_mark)
printf(", mark %u", con->se_mark);
printf("\n");