| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ipsec.c,v 1.53 2011/06/05 01:45:37 christos Exp $ */ | | 1 | /* $NetBSD: ipsec.c,v 1.54 2011/06/08 16:24:50 dyoung Exp $ */ |
2 | /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */ | | 2 | /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */ |
3 | /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ | | 3 | /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ |
4 | | | 4 | |
5 | /* | | 5 | /* |
6 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | | 6 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -22,27 +22,27 @@ | | | @@ -22,27 +22,27 @@ |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE | | 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | * SUCH DAMAGE. | | 31 | * SUCH DAMAGE. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #include <sys/cdefs.h> | | 34 | #include <sys/cdefs.h> |
35 | __KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.53 2011/06/05 01:45:37 christos Exp $"); | | 35 | __KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.54 2011/06/08 16:24:50 dyoung Exp $"); |
36 | | | 36 | |
37 | /* | | 37 | /* |
38 | * IPsec controller part. | | 38 | * IPsec controller part. |
39 | */ | | 39 | */ |
40 | | | 40 | |
41 | #include "opt_inet.h" | | 41 | #include "opt_inet.h" |
42 | #ifdef __FreeBSD__ | | 42 | #ifdef __FreeBSD__ |
43 | #include "opt_inet6.h" | | 43 | #include "opt_inet6.h" |
44 | #endif | | 44 | #endif |
45 | #include "opt_ipsec.h" | | 45 | #include "opt_ipsec.h" |
46 | | | 46 | |
47 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
48 | #include <sys/systm.h> | | 48 | #include <sys/systm.h> |
| @@ -1214,27 +1214,27 @@ ipsec_copy_policy(const struct inpcbpoli | | | @@ -1214,27 +1214,27 @@ ipsec_copy_policy(const struct inpcbpoli |
1214 | } else | | 1214 | } else |
1215 | return ENOBUFS; | | 1215 | return ENOBUFS; |
1216 | | | 1216 | |
1217 | new->priv = old->priv; | | 1217 | new->priv = old->priv; |
1218 | | | 1218 | |
1219 | return 0; | | 1219 | return 0; |
1220 | } | | 1220 | } |
1221 | | | 1221 | |
1222 | /* deep-copy a policy in PCB */ | | 1222 | /* deep-copy a policy in PCB */ |
1223 | static struct secpolicy * | | 1223 | static struct secpolicy * |
1224 | ipsec_deepcopy_policy(const struct secpolicy *src) | | 1224 | ipsec_deepcopy_policy(const struct secpolicy *src) |
1225 | { | | 1225 | { |
1226 | struct ipsecrequest *newchain = NULL; | | 1226 | struct ipsecrequest *newchain = NULL; |
1227 | const struct ipsecrequest *p; | | 1227 | struct ipsecrequest *p; |
1228 | struct ipsecrequest **q; | | 1228 | struct ipsecrequest **q; |
1229 | struct ipsecrequest *r; | | 1229 | struct ipsecrequest *r; |
1230 | struct secpolicy *dst; | | 1230 | struct secpolicy *dst; |
1231 | | | 1231 | |
1232 | if (src == NULL) | | 1232 | if (src == NULL) |
1233 | return NULL; | | 1233 | return NULL; |
1234 | dst = KEY_NEWSP(); | | 1234 | dst = KEY_NEWSP(); |
1235 | if (dst == NULL) | | 1235 | if (dst == NULL) |
1236 | return NULL; | | 1236 | return NULL; |
1237 | | | 1237 | |
1238 | /* | | 1238 | /* |
1239 | * deep-copy IPsec request chain. This is required since struct | | 1239 | * deep-copy IPsec request chain. This is required since struct |
1240 | * ipsecrequest is not reference counted. | | 1240 | * ipsecrequest is not reference counted. |