diff options
4 files changed, 655 insertions, 2 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 new file mode 100644 index 0000000000..9377f57cb0 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch | |||
| @@ -0,0 +1,385 @@ | |||
| 1 | From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Kevin Cernekee <cernekee@chromium.org> | ||
| 3 | Date: Wed, 4 Jan 2017 14:30:26 -0800 | ||
| 4 | Subject: Use __EXPORTED rather than EXPORT_SYMBOL | ||
| 5 | |||
| 6 | clang is sensitive to the ordering of | ||
| 7 | __attribute__((visibility("default"))) relative to the function | ||
| 8 | body. gcc is not. So if we try to re-declare an existing function | ||
| 9 | with default visibility, clang prints a warning and generates | ||
| 10 | a broken .so file in which nfct_helper_* are not exported to library | ||
| 11 | callers. | ||
| 12 | |||
| 13 | Move the attribute up into the function definition to make clang happy. | ||
| 14 | |||
| 15 | Signed-off-by: Kevin Cernekee <cernekee@chromium.org> | ||
| 16 | Signed-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 | |||
| 23 | diff --git a/doxygen.cfg.in b/doxygen.cfg.in | ||
| 24 | index cac9b05..190b7cd 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 | ||
| 32 | +EXCLUDE_SYMBOLS = | ||
| 33 | EXAMPLE_PATH = | ||
| 34 | EXAMPLE_PATTERNS = | ||
| 35 | EXAMPLE_RECURSIVE = NO | ||
| 36 | diff --git a/src/internal.h b/src/internal.h | ||
| 37 | index 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 | ||
| 53 | diff --git a/src/libnetfilter_cthelper.c b/src/libnetfilter_cthelper.c | ||
| 54 | index f8f58e6..af543a1 100644 | ||
| 55 | --- a/src/libnetfilter_cthelper.c | ||
| 56 | +++ b/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 *h) | ||
| 78 | } | ||
| 79 | free(h); | ||
| 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_helper_policy *p, | ||
| 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_set); | ||
| 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_set_u32); | ||
| 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 *h, | ||
| 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_helper *nfct_helper, enum nfct_helper_attr_ty | ||
| 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 nfct_helper *helper, | ||
| 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_t 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, uint8_t cmd, | ||
| 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 nlmsghdr *nlh, | ||
| 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 nlmsghdr *nlh, struct nfct_helper *h) | ||
| 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 struct nlattr *attr, void *data) | ||
| 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 struct nlmsghdr *nlh, | ||
| 376 | } | ||
| 377 | return 0; | ||
| 378 | } | ||
| 379 | -EXPORT_SYMBOL(nfct_helper_nlmsg_parse_payload); | ||
| 380 | |||
| 381 | /** | ||
| 382 | * @} | ||
| 383 | -- | ||
| 384 | cgit v1.1 | ||
| 385 | |||
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 new file mode 100644 index 0000000000..2c606c832d --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch | |||
| @@ -0,0 +1,264 @@ | |||
| 1 | From d0c4e39d12f903e06db262656cff2e24d267bed7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Kevin Cernekee <cernekee@chromium.org> | ||
| 3 | Date: Wed, 4 Jan 2017 14:30:25 -0800 | ||
| 4 | Subject: Use __EXPORTED rather than EXPORT_SYMBOL | ||
| 5 | |||
| 6 | clang is sensitive to the ordering of | ||
| 7 | __attribute__((visibility("default"))) relative to the function | ||
| 8 | body. gcc is not. So if we try to re-declare an existing function | ||
| 9 | with default visibility, clang prints a warning and generates | ||
| 10 | a broken .so file in which nfct_timeout_* are not exported to library | ||
| 11 | callers. | ||
| 12 | |||
| 13 | Move the attribute up into the function definition to make clang happy. | ||
| 14 | |||
| 15 | Signed-off-by: Kevin Cernekee <cernekee@chromium.org> | ||
| 16 | Signed-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 | |||
| 23 | diff --git a/doxygen.cfg.in b/doxygen.cfg.in | ||
| 24 | index 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 | ||
| 36 | diff --git a/src/internal.h b/src/internal.h | ||
| 37 | index 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 | ||
| 53 | diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c | ||
| 54 | index 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 | -- | ||
| 263 | cgit v1.1 | ||
| 264 | |||
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 index 3d37997266..92cb23d6e9 100644 --- a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb | |||
| @@ -6,7 +6,9 @@ LICENSE = "GPLv2+" | |||
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" |
| 7 | DEPENDS = "libmnl" | 7 | DEPENDS = "libmnl" |
| 8 | 8 | ||
| 9 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar" | 9 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar \ |
| 10 | file://libnetfilter-cthelper-visibility-hidden.patch \ | ||
| 11 | " | ||
| 10 | SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd" | 12 | SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd" |
| 11 | SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d" | 13 | SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d" |
| 12 | 14 | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb index dcf7485629..ff32f3409d 100644 --- a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb | |||
| @@ -5,7 +5,9 @@ LICENSE = "GPLv2+" | |||
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" |
| 6 | DEPENDS = "libmnl" | 6 | DEPENDS = "libmnl" |
| 7 | 7 | ||
| 8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar" | 8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar \ |
| 9 | file://libnetfilter-cttimeout-visibility-hidden.patch \ | ||
| 10 | " | ||
| 9 | SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" | 11 | SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" |
| 10 | SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" | 12 | SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" |
| 11 | 13 | ||
