diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-13 13:23:16 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-08-13 13:23:16 +0000 |
commit | 7558101cf54e3ecde54fbd01f31fa636c4fbf2ab (patch) | |
tree | 26cc2a8c7cb65debc46a6f8434be27774c6a8a5f /sbin | |
parent | 80dd80170dd11e7144c1689ea9f17c6a0e1a40e9 (diff) |
need to use IPV6_IPSEC_POLICY for IPv6 bypass policy setting. from the
country of humppa.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/isakmpd/sysdep/netbsd/sysdep.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sbin/isakmpd/sysdep/netbsd/sysdep.c b/sbin/isakmpd/sysdep/netbsd/sysdep.c index 34a785c0a14..87e6c47b3c0 100644 --- a/sbin/isakmpd/sysdep/netbsd/sysdep.c +++ b/sbin/isakmpd/sysdep/netbsd/sysdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysdep.c,v 1.9 2001/08/12 12:03:02 heko Exp $ */ +/* $OpenBSD: sysdep.c,v 1.10 2001/08/13 13:23:15 itojun Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -124,6 +124,8 @@ sysdep_cleartext (int fd, int af) char *policy[] = { "in bypass", "out bypass", NULL }; char **p; int ipp; + int opt; + char *msgstr; if (app_none) return 0; @@ -132,9 +134,13 @@ sysdep_cleartext (int fd, int af) { case AF_INET: ipp = IPPROTO_IP; + opt = IP_IPSEC_POLICY; + msgstr = ""; break; case AF_INET6: ipp = IPPROTO_IPV6; + opt = IPV6_IPSEC_POLICY; + msgstr = "V6"; break; default: log_print ("sysdep_cleartext: unsupported protocol family %d", af); @@ -155,12 +161,11 @@ sysdep_cleartext (int fd, int af) return -1; } - if (setsockopt(fd, ipp, IP_IPSEC_POLICY, buf, - ipsec_get_policylen(buf)) < 0) + if (setsockopt(fd, ipp, opt, buf, ipsec_get_policylen(buf)) < 0) { log_error ("sysdep_cleartext: " - "setsockopt (%d, IPPROTO_IP, IP_IPSEC_POLICY, ...) failed", - fd); + "setsockopt (%d, IPPROTO_IP%s, IP%s_IPSEC_POLICY, ...) " + "failed", fd, msgstr, msgstr); return -1; } free(buf); |