summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/sysdep/openbsd
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/isakmpd/sysdep/openbsd')
-rw-r--r--sbin/isakmpd/sysdep/openbsd/sysdep.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/sbin/isakmpd/sysdep/openbsd/sysdep.c b/sbin/isakmpd/sysdep/openbsd/sysdep.c
index 9c1acd0b613..31d979e3812 100644
--- a/sbin/isakmpd/sysdep/openbsd/sysdep.c
+++ b/sbin/isakmpd/sysdep/openbsd/sysdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysdep.c,v 1.19 2001/08/22 20:59:14 ho Exp $ */
+/* $OpenBSD: sysdep.c,v 1.20 2001/08/23 19:07:00 niklas Exp $ */
/* $EOM: sysdep.c,v 1.9 2000/12/04 04:46:35 angelos Exp $ */
/*
@@ -140,10 +140,28 @@ sysdep_cleartext (int fd, int af)
int ipcomp_level;
} optsw[] =
{
- { 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_IPCOMP_LEVEL },
+ {
+ IPPROTO_IP,
+ IP_AUTH_LEVEL,
+ IP_ESP_TRANS_LEVEL,
+ IP_ESP_NETWORK_LEVEL,
+#ifdef IP_IPCOMP_LEVEL
+ IP_IPCOMP_LEVEL
+#else
+ 0
+#endif
+ },
+ {
+ IPPROTO_IPV6,
+ IPV6_AUTH_LEVEL,
+ IPV6_ESP_TRANS_LEVEL,
+ IPV6_ESP_NETWORK_LEVEL,
+#ifdef IPV6_IPCOMP_LEVEL
+ IPV6_IPCOMP_LEVEL
+#else
+ 0
+#endif
+ },
};
if (app_none)
@@ -191,8 +209,9 @@ 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
+ if (optsw[sw].ipcomp_level
+ && setsockopt (fd, optsw[sw].ip_proto, optsw[sw].ipcomp_level,
+ (char *)&level, sizeof level) == -1
&& errno != ENOPROTOOPT)
{
log_error("sysdep_cleartext: "