summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2001-08-22 06:58:01 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2001-08-22 06:58:01 +0000
commitfc82a13a4433e7f85cbbbaa39a3c20d1dcb0cec8 (patch)
tree68aeee1365d741119f6c2d34d3bcd4759bb90e82
parent4dae913ed92dc9cdd1aa96afa0f94a276467877c (diff)
Bypass IPCOMP too.
-rw-r--r--sbin/isakmpd/sysdep/openbsd/sysdep.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sbin/isakmpd/sysdep/openbsd/sysdep.c b/sbin/isakmpd/sysdep/openbsd/sysdep.c
index 2551a5948c4..ea06cd5b833 100644
--- a/sbin/isakmpd/sysdep/openbsd/sysdep.c
+++ b/sbin/isakmpd/sysdep/openbsd/sysdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysdep.c,v 1.15 2001/08/12 12:03:02 heko Exp $ */
+/* $OpenBSD: sysdep.c,v 1.16 2001/08/22 06:58:00 niklas Exp $ */
/* $EOM: sysdep.c,v 1.9 2000/12/04 04:46:35 angelos Exp $ */
/*
@@ -131,17 +131,18 @@ int
sysdep_cleartext (int fd, int af)
{
int level, sw;
- struct
- {
+ struct {
int ip_proto; /* IP protocol */
int auth_level;
int esp_trans_level;
int esp_network_level;
- } optsw[] =
+ int ipcomp_level;
+ } optsw[] =
{
- { IPPROTO_IP, IP_AUTH_LEVEL, IP_ESP_TRANS_LEVEL, IP_ESP_NETWORK_LEVEL },
+ { IPPROTO_IP, IP_AUTH_LEVEL, IP_ESP_TRANS_LEVEL, IP_ESP_NETWORK_LEVEL,
+ IP_IPCOMP_LEVEL },
{ IPPROTO_IPV6, IPV6_AUTH_LEVEL, IPV6_ESP_TRANS_LEVEL,
- IPV6_ESP_NETWORK_LEVEL },
+ IPV6_ESP_NETWORK_LEVEL, IPV6_IPCOMP_LEVEL },
};
if (app_none)
@@ -189,6 +190,14 @@ sysdep_cleartext (int fd, int af)
optsw[sw].ip_proto);
return -1;
}
+ if (setsockopt (fd, optsw[sw].ip_proto, optsw[sw].ipcomp_level,
+ (char *)&level, sizeof level) == -1)
+ {
+ log_error("sysdep_cleartext: "
+ "setsockopt (%d, %d, IP_IPCOMP_LEVEL, ...) failed", fd,
+ optsw[sw].ip_proto);
+ return -1;
+ }
return 0;
}