summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhshoexer <hshoexer@openbsd.org>2008-01-04 11:06:02 +0000
committerhshoexer <hshoexer@openbsd.org>2008-01-04 11:06:02 +0000
commit6377a86f606e292a15566400eaa4dda48f699366 (patch)
tree60ec48db2148049962b42b533d3f19cee35bfa07
parentFix TX padding. (diff)
downloadwireguard-openbsd-6377a86f606e292a15566400eaa4dda48f699366.tar.xz
wireguard-openbsd-6377a86f606e292a15566400eaa4dda48f699366.zip
Strip off trailing '/32' when address type is IPV4_ADDR as isakmpd does
not accept the trailing '/32'. Diff from Mitja Muzenic <mitja@muzenic.net>, thanks!
-rw-r--r--sbin/ipsecctl/ike.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/ipsecctl/ike.c b/sbin/ipsecctl/ike.c
index bf0233c488c..735e58040bc 100644
--- a/sbin/ipsecctl/ike.c
+++ b/sbin/ipsecctl/ike.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ike.c,v 1.61 2007/03/16 20:51:01 markus Exp $ */
+/* $OpenBSD: ike.c,v 1.62 2008/01/04 11:06:02 hshoexer Exp $ */
/*
* Copyright (c) 2005 Hans-Joerg Hoexer <hshoexer@openbsd.org>
*
@@ -489,6 +489,8 @@ ike_section_p2ids(struct ipsec_rule *r, FILE *fd)
} else {
fprintf(fd, SET "[lid-%s]:ID-type=IPV%d_ADDR force\n",
r->p2lid, ((src->af == AF_INET) ? 4 : 6));
+ if ((p = strrchr(src->name, '/')) != NULL)
+ *p = '\0';
fprintf(fd, SET "[lid-%s]:Address=%s force\n", r->p2lid,
src->name);
}
@@ -529,6 +531,8 @@ ike_section_p2ids(struct ipsec_rule *r, FILE *fd)
} else {
fprintf(fd, SET "[rid-%s]:ID-type=IPV%d_ADDR force\n",
r->p2rid, ((dst->af == AF_INET) ? 4 : 6));
+ if ((p = strrchr(dst->name, '/')) != NULL)
+ *p = '\0';
fprintf(fd, SET "[rid-%s]:Address=%s force\n", r->p2rid,
dst->name);
}