summaryrefslogtreecommitdiff
path: root/sbin/ipsecadm
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-03-28 19:15:44 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-03-28 19:15:44 +0000
commitd1548f4c063f6d282477c35a7bf64211390e1c50 (patch)
tree8066039e89d24d6d7d6657b359ed497f8346366b /sbin/ipsecadm
parentf3cf21a532fb1ab62e075fa2ae14367654eab718 (diff)
Fix range checking on SPIs (Jean-Jacques.Bernard@hsc.fr)
Diffstat (limited to 'sbin/ipsecadm')
-rw-r--r--sbin/ipsecadm/ipsecadm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/ipsecadm/ipsecadm.c b/sbin/ipsecadm/ipsecadm.c
index fb9ba03b367..7e6143ca823 100644
--- a/sbin/ipsecadm/ipsecadm.c
+++ b/sbin/ipsecadm/ipsecadm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsecadm.c,v 1.51 2001/03/22 03:34:18 angelos Exp $ */
+/* $OpenBSD: ipsecadm.c,v 1.52 2001/03/28 19:15:43 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -666,14 +666,14 @@ main(int argc, char **argv)
if (!strcmp(argv[i] + 1, "spi") && spi == SPI_LOCAL_USE &&
(i + 1 < argc) && !bypass && !deny)
{
- spi = htonl(strtoul(argv[i + 1], NULL, 16));
+ spi = strtoul(argv[i + 1], NULL, 16);
if (spi >= SPI_RESERVED_MIN && spi <= SPI_RESERVED_MAX)
{
fprintf(stderr, "%s: invalid spi %s\n", argv[0], argv[i + 1]);
exit(1);
}
- sa.sadb_sa_spi = spi;
+ sa.sadb_sa_spi = htonl(spi);
i++;
continue;
}
@@ -681,7 +681,7 @@ main(int argc, char **argv)
if (!strcmp(argv[i] + 1, "spi2") && spi2 == SPI_LOCAL_USE &&
iscmd(mode, GRP_SPI) && (i + 1 < argc))
{
- spi2 = htonl(strtoul(argv[i + 1], NULL, 16));
+ spi2 = strtoul(argv[i + 1], NULL, 16);
if (spi2 == SPI_LOCAL_USE ||
(spi2 >= SPI_RESERVED_MIN && spi2 <= SPI_RESERVED_MAX))
{
@@ -689,7 +689,7 @@ main(int argc, char **argv)
exit(1);
}
- sa2.sadb_sa_spi = spi2;
+ sa2.sadb_sa_spi = htonl(spi2);
i++;
continue;
}