summaryrefslogtreecommitdiff
path: root/sbin/ipsecctl
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-06-01 02:19:23 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-06-01 02:19:23 +0000
commit2602933dc674699bd06c8c11af10ec1e7854feab (patch)
treebf5bbc2ed878dcea2f486f18f6a3ac8bff1b6d71 /sbin/ipsecctl
parent7e12e4ad1d2380b7f1a2d253e4dcc8f2a01e8683 (diff)
Generate correct configuration for default peers.
Diffstat (limited to 'sbin/ipsecctl')
-rw-r--r--sbin/ipsecctl/ike.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sbin/ipsecctl/ike.c b/sbin/ipsecctl/ike.c
index 4716751c87a..81c4ec1bc63 100644
--- a/sbin/ipsecctl/ike.c
+++ b/sbin/ipsecctl/ike.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike.c,v 1.29 2006/05/31 02:28:35 hshoexer Exp $ */
+/* $OpenBSD: ike.c,v 1.30 2006/06/01 02:19:22 hshoexer Exp $ */
/*
* Copyright (c) 2005 Hans-Joerg Hoexer <hshoexer@openbsd.org>
*
@@ -115,23 +115,28 @@ ike_section_ids(struct ipsec_addr_wrap *peer, struct ipsec_auth *auth, FILE *fd,
fprintf(fd, SET "[peer-%s]:ID=%s-ID force\n",
peer->name, "local");
else
- fprintf(fd, SET "[peer-default]:ID=default-ID force\n");
+ fprintf(fd, SET "[peer-default]:ID=%s-ID force\n",
+ "local");
fprintf(fd, SET "[%s-ID]:ID-type=FQDN force\n", "local");
fprintf(fd, SET "[%s-ID]:Name=%s force\n", "local",
auth->srcid);
}
if (auth->dstid) {
- if (peer)
+ if (peer) {
fprintf(fd, SET "[peer-%s]:Remote-ID=%s-ID force\n",
peer->name, peer->name);
- else
+ fprintf(fd, SET "[%s-ID]:ID-type=FQDN force\n",
+ peer->name);
+ fprintf(fd, SET "[%s-ID]:Name=%s force\n", peer->name,
+ auth->dstid);
+ } else {
fprintf(fd, SET
"[peer-default]:Remote-ID=default-ID force\n");
-
- fprintf(fd, SET "[%s-ID]:ID-type=FQDN force\n", peer->name);
- fprintf(fd, SET "[%s-ID]:Name=%s force\n", peer->name,
- auth->dstid);
+ fprintf(fd, SET "[default-ID]:ID-type=FQDN force\n");
+ fprintf(fd, SET "[default-ID]:Name=%s force\n",
+ auth->dstid);
+ }
}
}