summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch382
-rw-r--r--meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb17
-rw-r--r--meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.1.bb17
3 files changed, 17 insertions, 399 deletions
diff --git a/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch b/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
deleted file mode 100644
index e717d5b0e3..0000000000
--- a/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
+++ /dev/null
@@ -1,382 +0,0 @@
1From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001
2From: Kevin Cernekee <cernekee@chromium.org>
3Date: Wed, 4 Jan 2017 14:30:26 -0800
4Subject: Use __EXPORTED rather than EXPORT_SYMBOL
5
6clang is sensitive to the ordering of
7__attribute__((visibility("default"))) relative to the function
8body. gcc is not. So if we try to re-declare an existing function
9with default visibility, clang prints a warning and generates
10a broken .so file in which nfct_helper_* are not exported to library
11callers.
12
13Move the attribute up into the function definition to make clang happy.
14
15Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
16Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
17---
18 doxygen.cfg.in | 2 +-
19 src/internal.h | 5 ++-
20 src/libnetfilter_cthelper.c | 83 ++++++++++++++++++---------------------------
21 3 files changed, 36 insertions(+), 54 deletions(-)
22
23Index: libnetfilter_cthelper-1.0.0/doxygen.cfg.in
24===================================================================
25--- libnetfilter_cthelper-1.0.0.orig/doxygen.cfg.in
26+++ libnetfilter_cthelper-1.0.0/doxygen.cfg.in
27@@ -72,7 +72,7 @@ RECURSIVE = YES
28 EXCLUDE =
29 EXCLUDE_SYMLINKS = NO
30 EXCLUDE_PATTERNS = */.git/* .*.d
31-EXCLUDE_SYMBOLS = EXPORT_SYMBOL
32+EXCLUDE_SYMBOLS =
33 EXAMPLE_PATH =
34 EXAMPLE_PATTERNS =
35 EXAMPLE_RECURSIVE = NO
36Index: libnetfilter_cthelper-1.0.0/src/internal.h
37===================================================================
38--- libnetfilter_cthelper-1.0.0.orig/src/internal.h
39+++ libnetfilter_cthelper-1.0.0/src/internal.h
40@@ -3,10 +3,9 @@
41
42 #include "config.h"
43 #ifdef HAVE_VISIBILITY_HIDDEN
44-# define __visible __attribute__((visibility("default")))
45-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
46+# define __EXPORTED __attribute__((visibility("default")))
47 #else
48-# define EXPORT_SYMBOL
49+# define __EXPORTED
50 #endif
51
52 #endif
53Index: libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c
54===================================================================
55--- libnetfilter_cthelper-1.0.0.orig/src/libnetfilter_cthelper.c
56+++ libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c
57@@ -99,17 +99,16 @@ struct nfct_helper {
58 * In case of success, this function returns a valid pointer, otherwise NULL
59 * s returned and errno is appropriately set.
60 */
61-struct nfct_helper *nfct_helper_alloc(void)
62+struct nfct_helper __EXPORTED *nfct_helper_alloc(void)
63 {
64 return calloc(1, sizeof(struct nfct_helper));
65 }
66-EXPORT_SYMBOL(nfct_helper_alloc);
67
68 /**
69 * nfct_helper_free - release one helper object
70 * \param nfct_helper pointer to the helper object
71 */
72-void nfct_helper_free(struct nfct_helper *h)
73+void __EXPORTED nfct_helper_free(struct nfct_helper *h)
74 {
75 int i;
76
77@@ -119,7 +118,6 @@ void nfct_helper_free(struct nfct_helper
78 free(h->expect_policy[i]);
79 }
80 }
81-EXPORT_SYMBOL(nfct_helper_free);
82
83 /**
84 * nfct_helper_policy_alloc - allocate a new helper policy object
85@@ -127,21 +125,19 @@ EXPORT_SYMBOL(nfct_helper_free);
86 * In case of success, this function returns a valid pointer, otherwise NULL
87 * s returned and errno is appropriately set.
88 */
89-struct nfct_helper_policy *nfct_helper_policy_alloc(void)
90+struct nfct_helper_policy __EXPORTED *nfct_helper_policy_alloc(void)
91 {
92 return calloc(1, sizeof(struct nfct_helper_policy));
93 }
94-EXPORT_SYMBOL(nfct_helper_policy_alloc);
95
96 /**
97 * nfct_helper_free - release one helper policy object
98 * \param nfct_helper pointer to the helper object
99 */
100-void nfct_helper_policy_free(struct nfct_helper_policy *p)
101+void __EXPORTED nfct_helper_policy_free(struct nfct_helper_policy *p)
102 {
103 free(p);
104 }
105-EXPORT_SYMBOL(nfct_helper_policy_free);
106
107 /**
108 * nfct_helper_policy_attr_set - set one attribute of the helper object
109@@ -149,7 +145,7 @@ EXPORT_SYMBOL(nfct_helper_policy_free);
110 * \param type attribute type you want to set
111 * \param data pointer to data that will be used to set this attribute
112 */
113-void
114+void __EXPORTED
115 nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
116 enum nfct_helper_policy_attr_type type,
117 const void *data)
118@@ -170,7 +166,6 @@ nfct_helper_policy_attr_set(struct nfct_
119 break;
120 }
121 }
122-EXPORT_SYMBOL(nfct_helper_policy_attr_set);
123
124 /**
125 * nfct_helper_attr_set_str - set one attribute the helper object
126@@ -178,23 +173,21 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_se
127 * \param type attribute type you want to set
128 * \param name string that will be used to set this attribute
129 */
130-void
131+void __EXPORTED
132 nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p,
133 enum nfct_helper_policy_attr_type type,
134 const char *name)
135 {
136 nfct_helper_policy_attr_set(p, type, name);
137 }
138-EXPORT_SYMBOL(nfct_helper_policy_attr_set_str);
139
140-void
141+void __EXPORTED
142 nfct_helper_policy_attr_set_u32(struct nfct_helper_policy *p,
143 enum nfct_helper_policy_attr_type type,
144 uint32_t value)
145 {
146 nfct_helper_policy_attr_set(p, type, &value);
147 }
148-EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
149
150 /**
151 * nfct_helper_attr_set - set one attribute of the helper object
152@@ -202,7 +195,7 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_se
153 * \param type attribute type you want to set
154 * \param data pointer to data that will be used to set this attribute
155 */
156-void
157+void __EXPORTED
158 nfct_helper_attr_set(struct nfct_helper *h,
159 enum nfct_helper_attr_type type, const void *data)
160 {
161@@ -250,7 +243,6 @@ nfct_helper_attr_set(struct nfct_helper
162 break;
163 }
164 }
165-EXPORT_SYMBOL(nfct_helper_attr_set);
166
167 /**
168 * nfct_helper_attr_set_str - set one attribute the helper object
169@@ -258,44 +250,40 @@ EXPORT_SYMBOL(nfct_helper_attr_set);
170 * \param type attribute type you want to set
171 * \param name string that will be used to set this attribute
172 */
173-void
174+void __EXPORTED
175 nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type,
176 const char *name)
177 {
178 nfct_helper_attr_set(nfct_helper, type, name);
179 }
180-EXPORT_SYMBOL(nfct_helper_attr_set_str);
181
182-void
183+void __EXPORTED
184 nfct_helper_attr_set_u8(struct nfct_helper *nfct_helper,
185 enum nfct_helper_attr_type type, uint8_t value)
186 {
187 nfct_helper_attr_set(nfct_helper, type, &value);
188 }
189-EXPORT_SYMBOL(nfct_helper_attr_set_u8);
190
191-void
192+void __EXPORTED
193 nfct_helper_attr_set_u16(struct nfct_helper *nfct_helper,
194 enum nfct_helper_attr_type type, uint16_t value)
195 {
196 nfct_helper_attr_set(nfct_helper, type, &value);
197 }
198-EXPORT_SYMBOL(nfct_helper_attr_set_u16);
199
200-void
201+void __EXPORTED
202 nfct_helper_attr_set_u32(struct nfct_helper *nfct_helper,
203 enum nfct_helper_attr_type type, uint32_t value)
204 {
205 nfct_helper_attr_set(nfct_helper, type, &value);
206 }
207-EXPORT_SYMBOL(nfct_helper_attr_set_u32);
208
209 /**
210 * nfct_helper_attr_unset - unset one attribute the helper object
211 * \param nfct_helper pointer to the helper object
212 * \param type attribute type you want to set
213 */
214-void
215+void __EXPORTED
216 nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
217 {
218 switch(type) {
219@@ -307,7 +295,6 @@ nfct_helper_attr_unset(struct nfct_helpe
220 break;
221 }
222 }
223-EXPORT_SYMBOL(nfct_helper_attr_unset);
224
225 /**
226 * nfct_helper_attr_get - get one attribute the helper object
227@@ -317,8 +304,9 @@ EXPORT_SYMBOL(nfct_helper_attr_unset);
228 * This function returns a valid pointer to the attribute data. If a
229 * unsupported attribute is used, this returns NULL.
230 */
231-const void *nfct_helper_attr_get(struct nfct_helper *helper,
232- enum nfct_helper_attr_type type)
233+const void __EXPORTED *
234+nfct_helper_attr_get(struct nfct_helper *helper,
235+ enum nfct_helper_attr_type type)
236 {
237 const void *ret = NULL;
238
239@@ -358,7 +346,6 @@ const void *nfct_helper_attr_get(struct
240 }
241 return ret;
242 }
243-EXPORT_SYMBOL(nfct_helper_attr_get);
244
245 /**
246 * nfct_helper_attr_get_str - get one attribute the helper object
247@@ -368,13 +355,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get);
248 * This function returns a valid pointer to the beginning of the string.
249 * If the attribute is unsupported, this returns NULL.
250 */
251-const char *
252+const char __EXPORTED *
253 nfct_helper_attr_get_str(struct nfct_helper *nfct_helper,
254 enum nfct_helper_attr_type type)
255 {
256 return (const char *)nfct_helper_attr_get(nfct_helper, type);
257 }
258-EXPORT_SYMBOL(nfct_helper_attr_get_str);
259
260 /**
261 * nfct_helper_attr_get_u8 - get one attribute the helper object
262@@ -384,12 +370,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_str);
263 * This function returns a unsigned 8-bits integer. If the attribute is
264 * unsupported, this returns NULL.
265 */
266-uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
267- enum nfct_helper_attr_type type)
268+uint8_t __EXPORTED
269+nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
270+ enum nfct_helper_attr_type type)
271 {
272 return *((uint8_t *)nfct_helper_attr_get(nfct_helper, type));
273 }
274-EXPORT_SYMBOL(nfct_helper_attr_get_u8);
275
276 /**
277 * nfct_helper_attr_get_u16 - get one attribute the helper object
278@@ -399,12 +385,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u8);
279 * This function returns a unsigned 16-bits integer. If the attribute is
280 * unsupported, this returns NULL.
281 */
282-uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
283- enum nfct_helper_attr_type type)
284+uint16_t __EXPORTED
285+nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
286+ enum nfct_helper_attr_type type)
287 {
288 return *((uint16_t *)nfct_helper_attr_get(nfct_helper, type));
289 }
290-EXPORT_SYMBOL(nfct_helper_attr_get_u16);
291
292 /**
293 * nfct_helper_attr_get_u32 - get one attribute the helper object
294@@ -414,12 +400,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u16);
295 * This function returns a unsigned 32-bits integer. If the attribute is
296 * unsupported, this returns NULL.
297 */
298-uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
299- enum nfct_helper_attr_type type)
300+uint32_t __EXPORTED
301+nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
302+ enum nfct_helper_attr_type type)
303 {
304 return *((uint32_t *)nfct_helper_attr_get(nfct_helper, type));
305 }
306-EXPORT_SYMBOL(nfct_helper_attr_get_u32);
307
308 /**
309 * nfct_helper_snprintf - print helper object into one buffer
310@@ -431,9 +417,10 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u32);
311 * This function returns -1 in case that some mandatory attributes are
312 * missing. On sucess, it returns 0.
313 */
314-int nfct_helper_snprintf(char *buf, size_t size,
315- struct nfct_helper *helper,
316- unsigned int type, unsigned int flags)
317+int __EXPORTED
318+nfct_helper_snprintf(char *buf, size_t size,
319+ struct nfct_helper *helper,
320+ unsigned int type, unsigned int flags)
321 {
322 int ret;
323
324@@ -454,7 +441,6 @@ int nfct_helper_snprintf(char *buf, size
325
326 return ret;
327 }
328-EXPORT_SYMBOL(nfct_helper_snprintf);
329
330 /**
331 * @}
332@@ -490,7 +476,7 @@ EXPORT_SYMBOL(nfct_helper_snprintf);
333 * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfct_helper object (if
334 * unused, otherwise you hit EBUSY).
335 */
336-struct nlmsghdr *
337+struct nlmsghdr __EXPORTED *
338 nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
339 uint16_t flags, uint32_t seq)
340 {
341@@ -509,7 +495,6 @@ nfct_helper_nlmsg_build_hdr(char *buf, u
342
343 return nlh;
344 }
345-EXPORT_SYMBOL(nfct_helper_nlmsg_build_hdr);
346
347 static void
348 nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
349@@ -530,7 +515,7 @@ nfct_helper_nlmsg_build_policy(struct nl
350 * \param nlh: netlink message that you want to use to add the payload.
351 * \param nfct_helper: pointer to a helper object
352 */
353-void
354+void __EXPORTED
355 nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
356 {
357 struct nlattr *nest;
358@@ -593,7 +578,6 @@ nfct_helper_nlmsg_build_payload(struct n
359 if (h->bitset & (1 << NFCTH_ATTR_STATUS))
360 mnl_attr_put_u32(nlh, NFCTH_STATUS, ntohl(h->status));
361 }
362-EXPORT_SYMBOL(nfct_helper_nlmsg_build_payload);
363
364 static int
365 nfct_helper_nlmsg_parse_tuple_cb(const struct nlattr *attr, void *data)
366@@ -795,7 +779,7 @@ nfct_helper_nlmsg_parse_attr_cb(const st
367 * This function returns -1 in case that some mandatory attributes are
368 * missing. On sucess, it returns 0.
369 */
370-int
371+int __EXPORTED
372 nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
373 struct nfct_helper *h)
374 {
375@@ -832,7 +816,6 @@ nfct_helper_nlmsg_parse_payload(const st
376 }
377 return 0;
378 }
379-EXPORT_SYMBOL(nfct_helper_nlmsg_parse_payload);
380
381 /**
382 * @}
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
deleted file mode 100644
index fea520d439..0000000000
--- a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
+++ /dev/null
@@ -1,17 +0,0 @@
1SUMMARY = "Netfilter connection tracking helper library"
2DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure"
3HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_cthelper/index.html"
4SECTION = "libs"
5LICENSE = "GPL-2.0-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
7DEPENDS = "libmnl"
8
9SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar \
10 file://libnetfilter-cthelper-visibility-hidden.patch \
11"
12SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd"
13SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d"
14
15S = "${WORKDIR}/libnetfilter_cthelper-${PV}"
16
17inherit autotools pkgconfig
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.1.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.1.bb
new file mode 100644
index 0000000000..ebb0eb2329
--- /dev/null
+++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.1.bb
@@ -0,0 +1,17 @@
1SUMMARY = "Netfilter connection tracking helper library"
2DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure"
3HOMEPAGE = "https://www.netfilter.org/projects/libnetfilter_cthelper/index.html"
4SECTION = "libs"
5LICENSE = "GPL-2.0-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
7DEPENDS = "libmnl"
8
9SRC_URI = "https://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2 \
10 "
11
12SRC_URI[md5sum] = "e59279645fe65d40dd7dfc82a797ca5b"
13SRC_URI[sha256sum] = "14073d5487233897355d3ff04ddc1c8d03cc5ba8d2356236aa88161a9f2dc912"
14
15S = "${WORKDIR}/libnetfilter_cthelper-${PV}"
16
17inherit autotools pkgconfig