Wed Jun 8 16:24:50 2011 UTC ()
Fiddle a bit with const's to make FAST_IPSEC compile.


(dyoung)
diff -r1.53 -r1.54 src/sys/netipsec/ipsec.c
diff -r1.27 -r1.28 src/sys/netipsec/ipsec.h

cvs diff -r1.53 -r1.54 src/sys/netipsec/ipsec.c (expand / switch to unified diff)

--- src/sys/netipsec/ipsec.c 2011/06/05 01:45:37 1.53
+++ src/sys/netipsec/ipsec.c 2011/06/08 16:24:50 1.54
@@ -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 */
1223static struct secpolicy * 1223static struct secpolicy *
1224ipsec_deepcopy_policy(const struct secpolicy *src) 1224ipsec_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.

cvs diff -r1.27 -r1.28 src/sys/netipsec/ipsec.h (expand / switch to unified diff)

--- src/sys/netipsec/ipsec.h 2011/06/05 01:40:40 1.27
+++ src/sys/netipsec/ipsec.h 2011/06/08 16:24:50 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ipsec.h,v 1.27 2011/06/05 01:40:40 christos Exp $ */ 1/* $NetBSD: ipsec.h,v 1.28 2011/06/08 16:24:50 dyoung Exp $ */
2/* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $ */ 2/* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $ */
3/* $KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $ */ 3/* $KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun 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
@@ -272,27 +272,27 @@ static __inline int @@ -272,27 +272,27 @@ static __inline int
272ipsec_copy_pcbpolicy( 272ipsec_copy_pcbpolicy(
273 struct inpcbpolicy *old, 273 struct inpcbpolicy *old,
274 struct inpcbpolicy *new 274 struct inpcbpolicy *new
275) 275)
276{ 276{
277 /*XXX do nothing */ 277 /*XXX do nothing */
278 return (0); 278 return (0);
279} 279}
280 280
281struct inpcb; 281struct inpcb;
282#define ipsec_init_pcbpolicy ipsec_init_policy 282#define ipsec_init_pcbpolicy ipsec_init_policy
283int ipsec_init_policy (struct socket *so, struct inpcbpolicy **); 283int ipsec_init_policy (struct socket *so, struct inpcbpolicy **);
284int ipsec_copy_policy 284int ipsec_copy_policy
285 (struct inpcbpolicy *, struct inpcbpolicy *); 285 (const struct inpcbpolicy *, struct inpcbpolicy *);
286u_int ipsec_get_reqlevel (const struct ipsecrequest *); 286u_int ipsec_get_reqlevel (const struct ipsecrequest *);
287int ipsec_in_reject (const struct secpolicy *, const struct mbuf *); 287int ipsec_in_reject (const struct secpolicy *, const struct mbuf *);
288 288
289int ipsec4_set_policy (struct inpcb *, int, void *, size_t, kauth_cred_t); 289int ipsec4_set_policy (struct inpcb *, int, void *, size_t, kauth_cred_t);
290int ipsec4_get_policy (struct inpcb *, void *, size_t, struct mbuf **); 290int ipsec4_get_policy (struct inpcb *, void *, size_t, struct mbuf **);
291int ipsec4_delete_pcbpolicy (struct inpcb *); 291int ipsec4_delete_pcbpolicy (struct inpcb *);
292int ipsec4_in_reject (struct mbuf *, struct inpcb *); 292int ipsec4_in_reject (struct mbuf *, struct inpcb *);
293/* 293/*
294 * KAME ipsec4_in_reject_so(struct mbuf*, struct so) compatibility shim 294 * KAME ipsec4_in_reject_so(struct mbuf*, struct so) compatibility shim
295 */ 295 */
296#define ipsec4_in_reject_so(m, _so) \ 296#define ipsec4_in_reject_so(m, _so) \
297 ipsec4_in_reject(m, ((_so) == NULL? NULL : sotoinpcb(_so))) 297 ipsec4_in_reject(m, ((_so) == NULL? NULL : sotoinpcb(_so)))
298 298