summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2008-01-04 11:06:03 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2008-01-04 11:06:03 +0000
commit3e54a52439eb6a6bf278cbdd88cbb45cf919644a (patch)
treed5f1ca8ee4659972d69c9200ec9b17866ac7f09a
parent57eac29b569c5c56b435eb66ce9139d947d4cba4 (diff)
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);
}