summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-09-29 19:06:54 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-09-29 19:06:54 +0000
commit5d2e6393f2e5c5125f9af9ba3a7d1aa36df70da5 (patch)
tree009f1fe6113dc356ae8d968df250804f6fc90868 /sbin
parent7504c2e7b48530e7487d85fea305d0ada89f34a5 (diff)
Update for no -spi use with flow
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipsecadm/ipsecadm.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sbin/ipsecadm/ipsecadm.c b/sbin/ipsecadm/ipsecadm.c
index 1d378cdeea0..fe23f172aca 100644
--- a/sbin/ipsecadm/ipsecadm.c
+++ b/sbin/ipsecadm/ipsecadm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsecadm.c,v 1.43 2000/09/21 02:38:20 angelos Exp $ */
+/* $OpenBSD: ipsecadm.c,v 1.44 2000/09/29 19:06:53 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -654,6 +654,14 @@ main(int argc, char **argv)
continue;
}
+ if (!strcmp(argv[i] + 1, "spi") && iscmd(mode, FLOW))
+ {
+ fprintf(stderr, "%s: use of flag \"-spi\" is deprecated with"
+ "flow creation or deletion\n", argv[0]);
+ i++;
+ continue;
+ }
+
if (!strcmp(argv[i] + 1, "spi") && spi == SPI_LOCAL_USE &&
(i + 1 < argc) && !bypass && !deny)
{
@@ -1644,14 +1652,6 @@ main(int argc, char **argv)
smsg.sadb_msg_len += sad2.sadb_address_len;
}
- if (sa.sadb_sa_spi != 0)
- {
- /* SA header */
- iov[cnt].iov_base = &sa;
- iov[cnt++].iov_len = sizeof(sa);
- smsg.sadb_msg_len += sa.sadb_sa_len;
- }
-
if ((sad1.sadb_address_exttype) &&
(smsg.sadb_msg_type != SADB_X_DELFLOW))
{
@@ -1741,7 +1741,8 @@ main(int argc, char **argv)
iov[cnt++].iov_len = ROUNDUP(odmask->sa.sa_len);
smsg.sadb_msg_len += sad7.sadb_address_len;
- if (srcid)
+ if ((srcid) &&
+ (smsg.sadb_msg_type != SADB_X_DELFLOW))
{
iov[cnt].iov_base = &sid1;
iov[cnt++].iov_len = sizeof(sid1);
@@ -1751,7 +1752,8 @@ main(int argc, char **argv)
smsg.sadb_msg_len += sid1.sadb_ident_len;
}
- if (dstid)
+ if ((dstid) &&
+ (smsg.sadb_msg_type != SADB_X_DELFLOW))
{
iov[cnt].iov_base = &sid2;
iov[cnt++].iov_len = sizeof(sid2);