summaryrefslogtreecommitdiff
path: root/sbin/iked/iked.c
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/iked.c
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/iked.c')
-rw-r--r--sbin/iked/iked.c10
1 files changed, 7 insertions, 3 deletions
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);