summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2020-11-20 12:38:27 +0000
committertobhe <tobhe@cvs.openbsd.org>2020-11-20 12:38:27 +0000
commitbfb04d7142b25d9b357290efd88f01385f1fbf18 (patch)
tree002b05e12bbb95c83fc89baaec4c1b18a18fbca3 /sbin/iked
parentdaaa4a0e706a5b99cca3b95e64878281baa4220f (diff)
Add -s socket option to specify control socket. This can be useful if
multiple iked instances running in different rdomains are used. ok patrick@
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/iked.89
-rw-r--r--sbin/iked/iked.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/sbin/iked/iked.8 b/sbin/iked/iked.8
index 7d33ab614c8..629e2d06518 100644
--- a/sbin/iked/iked.8
+++ b/sbin/iked/iked.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: iked.8,v 1.26 2020/04/09 19:55:19 tobhe Exp $
+.\" $OpenBSD: iked.8,v 1.27 2020/11/20 12:38:26 tobhe Exp $
.\"
.\" Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 9 2020 $
+.Dd $Mdocdate: November 20 2020 $
.Dt IKED 8
.Os
.Sh NAME
@@ -86,6 +86,11 @@ than 4500, the
.Xr sysctl 2
variable has to be set accordingly.
Implies -t.
+.It Fl s Ar socket
+Use
+.Ar socket
+as the control socket, instead of the default
+.Pa /var/run/iked.sock .
.It Fl S
Start
.Nm
diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c
index 4afd376253d..5c347198a8c 100644
--- a/sbin/iked/iked.c
+++ b/sbin/iked/iked.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.c,v 1.48 2020/09/23 14:25:55 tobhe Exp $ */
+/* $OpenBSD: iked.c,v 1.49 2020/11/20 12:38:26 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -70,12 +70,13 @@ main(int argc, char *argv[])
enum natt_mode natt_mode = NATT_DEFAULT;
in_port_t port = IKED_NATT_PORT;
const char *conffile = IKED_CONFIG;
+ const char *sock = IKED_SOCKET;
struct iked *env = NULL;
struct privsep *ps;
log_init(1, LOG_DAEMON);
- while ((c = getopt(argc, argv, "6dD:nf:p:vSTt")) != -1) {
+ while ((c = getopt(argc, argv, "6dD:nf:p:s:vSTt")) != -1) {
switch (c) {
case '6':
log_warnx("the -6 option is ignored and will be "
@@ -96,6 +97,9 @@ main(int argc, char *argv[])
case 'f':
conffile = optarg;
break;
+ case 's':
+ sock = optarg;
+ break;
case 'v':
verbose++;
opts |= IKED_OPT_VERBOSE;
@@ -154,7 +158,7 @@ main(int argc, char *argv[])
errx(1, "unknown user %s", IKED_USER);
/* Configure the control socket */
- ps->ps_csock.cs_name = IKED_SOCKET;
+ ps->ps_csock.cs_name = sock;
log_init(debug, LOG_DAEMON);
log_setverbose(verbose);