summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch264
-rw-r--r--meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.1.bb (renamed from meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb)10
2 files changed, 5 insertions, 269 deletions
diff --git a/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch b/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
deleted file mode 100644
index 2c606c832d..0000000000
--- a/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
+++ /dev/null
@@ -1,264 +0,0 @@
1From d0c4e39d12f903e06db262656cff2e24d267bed7 Mon Sep 17 00:00:00 2001
2From: Kevin Cernekee <cernekee@chromium.org>
3Date: Wed, 4 Jan 2017 14:30:25 -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_timeout_* 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_cttimeout.c | 44 +++++++++++++++++---------------------------
21 3 files changed, 20 insertions(+), 31 deletions(-)
22
23diff --git a/doxygen.cfg.in b/doxygen.cfg.in
24index 8e5d449..09c3ce0 100644
25--- a/doxygen.cfg.in
26+++ b/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 nfct_timeout _container_policy_cb
32+EXCLUDE_SYMBOLS = nfct_timeout _container_policy_cb
33 EXAMPLE_PATH =
34 EXAMPLE_PATTERNS =
35 EXAMPLE_RECURSIVE = NO
36diff --git a/src/internal.h b/src/internal.h
37index 3a88d1a..5d78171 100644
38--- a/src/internal.h
39+++ b/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
53diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c
54index 7844a1f..a0a7185 100644
55--- a/src/libnetfilter_cttimeout.c
56+++ b/src/libnetfilter_cttimeout.c
57@@ -187,7 +187,7 @@ struct nfct_timeout {
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_timeout *nfct_timeout_alloc(void)
62+struct nfct_timeout __EXPORTED *nfct_timeout_alloc(void)
63 {
64 struct nfct_timeout *t;
65
66@@ -197,19 +197,17 @@ struct nfct_timeout *nfct_timeout_alloc(void)
67
68 return t;
69 }
70-EXPORT_SYMBOL(nfct_timeout_alloc);
71
72 /**
73 * nfct_timeout_free - release one conntrack timeout object
74 * \param t pointer to the conntrack timeout object
75 */
76-void nfct_timeout_free(struct nfct_timeout *t)
77+void __EXPORTED nfct_timeout_free(struct nfct_timeout *t)
78 {
79 if (t->timeout)
80 free(t->timeout);
81 free(t);
82 }
83-EXPORT_SYMBOL(nfct_timeout_free);
84
85 /**
86 * nfct_timeout_attr_set - set one attribute of the conntrack timeout object
87@@ -217,7 +215,7 @@ EXPORT_SYMBOL(nfct_timeout_free);
88 * \param type attribute type you want to set
89 * \param data pointer to data that will be used to set this attribute
90 */
91-int
92+int __EXPORTED
93 nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
94 {
95 switch(type) {
96@@ -236,7 +234,6 @@ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
97 t->attrset |= (1 << type);
98 return 0;
99 }
100-EXPORT_SYMBOL(nfct_timeout_attr_set);
101
102 /**
103 * nfct_timeout_attr_set_u8 - set one attribute of the conntrack timeout object
104@@ -244,12 +241,11 @@ EXPORT_SYMBOL(nfct_timeout_attr_set);
105 * \param type attribute type you want to set
106 * \param data pointer to data that will be used to set this attribute
107 */
108-int
109+int __EXPORTED
110 nfct_timeout_attr_set_u8(struct nfct_timeout *t, uint32_t type, uint8_t data)
111 {
112 return nfct_timeout_attr_set(t, type, &data);
113 }
114-EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
115
116 /**
117 * nfct_timeout_attr_set_u16 - set one attribute of the conntrack timeout object
118@@ -257,23 +253,21 @@ EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
119 * \param type attribute type you want to set
120 * \param data pointer to data that will be used to set this attribute
121 */
122-int
123+int __EXPORTED
124 nfct_timeout_attr_set_u16(struct nfct_timeout *t, uint32_t type, uint16_t data)
125 {
126 return nfct_timeout_attr_set(t, type, &data);
127 }
128-EXPORT_SYMBOL(nfct_timeout_attr_set_u16);
129
130 /**
131 * nfct_timeout_attr_unset - unset one attribute of the conntrack timeout object
132 * \param t pointer to the conntrack timeout object
133 * \param type attribute type you want to set
134 */
135-void nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
136+void __EXPORTED nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
137 {
138 t->attrset &= ~(1 << type);
139 }
140-EXPORT_SYMBOL(nfct_timeout_attr_unset);
141
142 /**
143 * nfct_timeout_policy_attr_set_u32 - set one attribute of the policy
144@@ -281,7 +275,7 @@ EXPORT_SYMBOL(nfct_timeout_attr_unset);
145 * \param type attribute type you want to set
146 * \param data data that will be used to set this attribute
147 */
148-int
149+int __EXPORTED
150 nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
151 uint32_t type, uint32_t data)
152 {
153@@ -319,18 +313,17 @@ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
154
155 return 0;
156 }
157-EXPORT_SYMBOL(nfct_timeout_policy_attr_set_u32);
158
159 /**
160 * nfct_timeout_policy_attr_unset - unset one attribute of the policy
161 * \param t pointer to the conntrack timeout object
162 * \param type attribute type you want to set
163 */
164-void nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
165+void __EXPORTED
166+nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
167 {
168 t->attrset &= ~(1 << type);
169 }
170-EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
171
172 /**
173 * nfct_timeout_policy_attr_to_name - get state name from protocol state number
174@@ -340,7 +333,8 @@ EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
175 * This function returns NULL if unsupported protocol or state number is passed.
176 * Otherwise, a pointer to valid string is returned.
177 */
178-const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
179+const char __EXPORTED *
180+nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
181 {
182 if (timeout_protocol[l4proto].state_to_name == NULL) {
183 printf("no array state name\n");
184@@ -354,7 +348,6 @@ const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
185
186 return timeout_protocol[l4proto].state_to_name[state];
187 }
188-EXPORT_SYMBOL(nfct_timeout_policy_attr_to_name);
189
190 /**
191 * @}
192@@ -438,8 +431,9 @@ nfct_timeout_snprintf_default(char *buf, size_t size,
193 * This function returns -1 in case that some mandatory attributes are
194 * missing. On sucess, it returns 0.
195 */
196-int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
197- unsigned int type, unsigned int flags)
198+int __EXPORTED
199+nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
200+ unsigned int type, unsigned int flags)
201 {
202 int ret = 0;
203
204@@ -454,7 +448,6 @@ int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
205
206 return ret;
207 }
208-EXPORT_SYMBOL(nfct_timeout_snprintf);
209
210 /**
211 * @}
212@@ -477,7 +470,7 @@ EXPORT_SYMBOL(nfct_timeout_snprintf);
213 * - CTNL_MSG_TIMEOUT_GET: get conntrack timeout object.
214 * - CTNL_MSG_TIMEOUT_DEL: delete conntrack timeout object.
215 */
216-struct nlmsghdr *
217+struct nlmsghdr __EXPORTED *
218 nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
219 uint16_t flags, uint32_t seq)
220 {
221@@ -496,14 +489,13 @@ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
222
223 return nlh;
224 }
225-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_hdr);
226
227 /**
228 * nfct_timeout_nlmsg_build_payload - build payload from ct timeout object
229 * \param nlh: netlink message that you want to use to add the payload.
230 * \param t: pointer to a conntrack timeout object
231 */
232-void
233+void __EXPORTED
234 nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
235 const struct nfct_timeout *t)
236 {
237@@ -532,7 +524,6 @@ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
238 }
239
240 }
241-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_payload);
242
243 static int
244 timeout_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
245@@ -629,7 +620,7 @@ timeout_parse_attr_data(struct nfct_timeout *t, const struct nlattr *nest)
246 * This function returns -1 in case that some mandatory attributes are
247 * missing. On sucess, it returns 0.
248 */
249-int
250+int __EXPORTED
251 nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
252 struct nfct_timeout *t)
253 {
254@@ -654,7 +645,6 @@ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
255 }
256 return 0;
257 }
258-EXPORT_SYMBOL(nfct_timeout_nlmsg_parse_payload);
259
260 /**
261 * @}
262--
263cgit v1.1
264
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.1.bb
index dc87d9b123..5349e6e4b8 100644
--- a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
+++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.1.bb
@@ -5,11 +5,11 @@ LICENSE = "GPL-2.0-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" 5LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
6DEPENDS = "libmnl" 6DEPENDS = "libmnl"
7 7
8SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar \ 8SRC_URI = "https://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2 \
9 file://libnetfilter-cttimeout-visibility-hidden.patch \ 9 "
10" 10
11SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" 11SRC_URI[md5sum] = "ac64b55952b79cb9910db95ce8883940"
12SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" 12SRC_URI[sha256sum] = "0b59da2f3204e1c80cb85d1f6d72285fc07b01a2f5678abf5dccfbbefd650325"
13 13
14S = "${WORKDIR}/libnetfilter_cttimeout-${PV}" 14S = "${WORKDIR}/libnetfilter_cttimeout-${PV}"
15 15