bumps strongswan 2.8 for 2.4 kernels to latest version 2.8.11 (patch by edgar soldin)
[openwrt/svn-archive/archive.git] / net / strongswan / patches / 400-pluto-fix_CIRCLEQ.patch
1 diff -Nurp strongswan-2.8.11.orig/linux/include/circ-queue.h strongswan-2.8.11.queue/linux/include/circ-queue.h
2 --- strongswan-2.8.11.orig/linux/include/circ-queue.h 1970-01-01 01:00:00.000000000 +0100
3 +++ strongswan-2.8.11.queue/linux/include/circ-queue.h 2009-12-02 19:11:31.414549616 +0100
4 @@ -0,0 +1,131 @@
5 +/*
6 + * Copyright (c) 1991, 1993
7 + * The Regents of the University of California. All rights reserved.
8 + *
9 + * Redistribution and use in source and binary forms, with or without
10 + * modification, are permitted provided that the following conditions
11 + * are met:
12 + * 1. Redistributions of source code must retain the above copyright
13 + * notice, this list of conditions and the following disclaimer.
14 + * 2. Redistributions in binary form must reproduce the above copyright
15 + * notice, this list of conditions and the following disclaimer in the
16 + * documentation and/or other materials provided with the distribution.
17 + * 3. All advertising materials mentioning features or use of this software
18 + * must display the following acknowledgement:
19 + * This product includes software developed by the University of
20 + * California, Berkeley and its contributors.
21 + * 4. Neither the name of the University nor the names of its contributors
22 + * may be used to endorse or promote products derived from this software
23 + * without specific prior written permission.
24 + *
25 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 + * SUCH DAMAGE.
36 + *
37 + * @(#)queue.h 8.5 (Berkeley) 8/20/94
38 + * $FreeBSD: ports/misc/44bsd-more/files/queue.h,v 1.1 2001/01/06 03:41:36 hoek Exp $
39 + */
40 +
41 +/*
42 + * Circular queue definitions.
43 + */
44 +#define CIRCLEQ_HEAD(name, type) \
45 +struct name { \
46 + struct type *cqh_first; /* first element */ \
47 + struct type *cqh_last; /* last element */ \
48 +}
49 +
50 +#define CIRCLEQ_ENTRY(type) \
51 +struct { \
52 + struct type *cqe_next; /* next element */ \
53 + struct type *cqe_prev; /* previous element */ \
54 +}
55 +
56 +/*
57 + * Circular queue functions.
58 + */
59 +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
60 +
61 +#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
62 +
63 +#define CIRCLEQ_FOREACH(var, head, field) \
64 + for((var) = (head)->cqh_first; \
65 + (var) != (void *)(head); \
66 + (var) = (var)->field.cqe_next)
67 +
68 +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
69 + for((var) = (head)->cqh_last; \
70 + (var) != (void *)(head); \
71 + (var) = (var)->field.cqe_prev)
72 +
73 +#define CIRCLEQ_INIT(head) do { \
74 + (head)->cqh_first = (void *)(head); \
75 + (head)->cqh_last = (void *)(head); \
76 +} while (0)
77 +
78 +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
79 + (elm)->field.cqe_next = (listelm)->field.cqe_next; \
80 + (elm)->field.cqe_prev = (listelm); \
81 + if ((listelm)->field.cqe_next == (void *)(head)) \
82 + (head)->cqh_last = (elm); \
83 + else \
84 + (listelm)->field.cqe_next->field.cqe_prev = (elm); \
85 + (listelm)->field.cqe_next = (elm); \
86 +} while (0)
87 +
88 +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
89 + (elm)->field.cqe_next = (listelm); \
90 + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
91 + if ((listelm)->field.cqe_prev == (void *)(head)) \
92 + (head)->cqh_first = (elm); \
93 + else \
94 + (listelm)->field.cqe_prev->field.cqe_next = (elm); \
95 + (listelm)->field.cqe_prev = (elm); \
96 +} while (0)
97 +
98 +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
99 + (elm)->field.cqe_next = (head)->cqh_first; \
100 + (elm)->field.cqe_prev = (void *)(head); \
101 + if ((head)->cqh_last == (void *)(head)) \
102 + (head)->cqh_last = (elm); \
103 + else \
104 + (head)->cqh_first->field.cqe_prev = (elm); \
105 + (head)->cqh_first = (elm); \
106 +} while (0)
107 +
108 +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
109 + (elm)->field.cqe_next = (void *)(head); \
110 + (elm)->field.cqe_prev = (head)->cqh_last; \
111 + if ((head)->cqh_first == (void *)(head)) \
112 + (head)->cqh_first = (elm); \
113 + else \
114 + (head)->cqh_last->field.cqe_next = (elm); \
115 + (head)->cqh_last = (elm); \
116 +} while (0)
117 +
118 +#define CIRCLEQ_LAST(head) ((head)->cqh_last)
119 +
120 +#define CIRCLEQ_NEXT(elm,field) ((elm)->field.cqe_next)
121 +
122 +#define CIRCLEQ_PREV(elm,field) ((elm)->field.cqe_prev)
123 +
124 +#define CIRCLEQ_REMOVE(head, elm, field) do { \
125 + if ((elm)->field.cqe_next == (void *)(head)) \
126 + (head)->cqh_last = (elm)->field.cqe_prev; \
127 + else \
128 + (elm)->field.cqe_next->field.cqe_prev = \
129 + (elm)->field.cqe_prev; \
130 + if ((elm)->field.cqe_prev == (void *)(head)) \
131 + (head)->cqh_first = (elm)->field.cqe_next; \
132 + else \
133 + (elm)->field.cqe_prev->field.cqe_next = \
134 + (elm)->field.cqe_next; \
135 +} while (0)
136 diff -Nurp strongswan-2.8.11.orig/programs/pluto/connections.h strongswan-2.8.11.queue/programs/pluto/connections.h
137 --- strongswan-2.8.11.orig/programs/pluto/connections.h 2007-06-18 20:24:51.000000000 +0200
138 +++ strongswan-2.8.11.queue/programs/pluto/connections.h 2009-12-02 19:11:02.127064115 +0100
139 @@ -18,6 +18,10 @@
140 #define _CONNECTIONS_H
141
142 #include <sys/queue.h>
143 +/* This handles the 'syntax error before "CIRCLEQ_ENTRY"' */
144 +#ifndef CIRCLEQ_HEAD
145 +#include <circ-queue.h>
146 +#endif
147
148 #include "id.h"
149 #include "certs.h"