diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-03-26 11:49:42 -0700 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-04-25 15:55:35 -0400 |
commit | 729eae7490858b0f4b4231b318722c845d4fd3c1 (patch) | |
tree | 109039811ec0756898ba61ccd77912c6668f218f /meta-networking/recipes-filter | |
parent | d9dc6b2d4cb341958a6e37e9916ae193eb9714da (diff) | |
download | meta-openembedded-729eae7490858b0f4b4231b318722c845d4fd3c1.tar.gz |
libnfnetlink: Backport patches to fix musl build
There are few upstream patches that are required for getting it
working with musl, backport these patches on top of 1.0.1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-filter')
7 files changed, 664 insertions, 1 deletions
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch new file mode 100644 index 000000000..00d95cd79 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 2e5f2b81fb8cbe0d1cd33e58caa19ac308e1f847 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Engelhardt <jengelh@inai.de> | ||
3 | Date: Tue, 9 Oct 2012 15:59:48 +0200 | ||
4 | Subject: [PATCH 1/6] build: resolve automake-1.12 warnings | ||
5 | |||
6 | am/ltlibrary.am: warning: 'libnfnetlink.la': linking libtool libraries | ||
7 | using a non-POSIX archiver requires 'AM_PROG_AR' in 'configure.ac' | ||
8 | |||
9 | Signed-off-by: Jan Engelhardt <jengelh@inai.de> | ||
10 | --- | ||
11 | configure.ac | 1 + | ||
12 | 1 file changed, 1 insertion(+) | ||
13 | |||
14 | diff --git a/configure.ac b/configure.ac | ||
15 | index ed549df..0926a1c 100644 | ||
16 | --- a/configure.ac | ||
17 | +++ b/configure.ac | ||
18 | @@ -7,6 +7,7 @@ AC_CANONICAL_HOST | ||
19 | |||
20 | AM_INIT_AUTOMAKE([-Wall foreign subdir-objects | ||
21 | tar-pax no-dist-gzip dist-bzip2 1.6]) | ||
22 | +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | ||
23 | |||
24 | dnl kernel style compile messages | ||
25 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
26 | -- | ||
27 | 2.12.1 | ||
28 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch new file mode 100644 index 000000000..c2fb5e05a --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 5e6b6e23a8b04475c5a9de7eddb4c18103932fe5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pablo Neira Ayuso <pablo@netfilter.org> | ||
3 | Date: Wed, 7 Aug 2013 20:53:57 +0200 | ||
4 | Subject: [PATCH 2/6] src: get source code license header in sync with current | ||
5 | licensing terms | ||
6 | |||
7 | Since (3956761 license: upgrade to GPLv2+), we upgraded to GPLv2+, | ||
8 | propagate that changes to src/iftable.c and src/rtnl.c | ||
9 | |||
10 | Reported-by: Thomas Woerner <twoerner@redhat.com> | ||
11 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
12 | --- | ||
13 | src/iftable.c | 2 +- | ||
14 | src/rtnl.c | 4 ++-- | ||
15 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
16 | |||
17 | diff --git a/src/iftable.c b/src/iftable.c | ||
18 | index 0325335..5976ed8 100644 | ||
19 | --- a/src/iftable.c | ||
20 | +++ b/src/iftable.c | ||
21 | @@ -3,7 +3,7 @@ | ||
22 | * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com> | ||
23 | * (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org> | ||
24 | * | ||
25 | - * This software is Free Software and licensed under GNU GPLv2. | ||
26 | + * This software is Free Software and licensed under GNU GPLv2+. | ||
27 | */ | ||
28 | |||
29 | /* IFINDEX handling */ | ||
30 | diff --git a/src/rtnl.c b/src/rtnl.c | ||
31 | index 5ccb272..7b4ac7d 100644 | ||
32 | --- a/src/rtnl.c | ||
33 | +++ b/src/rtnl.c | ||
34 | @@ -1,10 +1,10 @@ | ||
35 | /* rtnl - rtnetlink utility functions | ||
36 | * | ||
37 | * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com> | ||
38 | - * | ||
39 | + * | ||
40 | * Adapted to nfnetlink by Eric Leblond <eric@inl.fr> | ||
41 | * | ||
42 | - * This software is free software and licensed under GNU GPLv2. | ||
43 | + * This software is free software and licensed under GNU GPLv2+. | ||
44 | * | ||
45 | */ | ||
46 | |||
47 | -- | ||
48 | 2.12.1 | ||
49 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch new file mode 100644 index 000000000..6cb7ed6fa --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From b259fe13826414c1bd5328a25c8d6d60e20e65f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gustavo Zacarias <gustavo@zacarias.com.ar> | ||
3 | Date: Tue, 10 Sep 2013 16:23:29 -0300 | ||
4 | Subject: [PATCH 3/6] configure: uclinux is also linux | ||
5 | |||
6 | Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> | ||
7 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
8 | --- | ||
9 | configure.ac | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/configure.ac b/configure.ac | ||
13 | index 0926a1c..b979772 100644 | ||
14 | --- a/configure.ac | ||
15 | +++ b/configure.ac | ||
16 | @@ -18,7 +18,7 @@ AC_DISABLE_STATIC | ||
17 | AM_PROG_LIBTOOL | ||
18 | |||
19 | case "$host" in | ||
20 | -*-*-linux*) ;; | ||
21 | +*-*-linux* | *-*-uclinux*) ;; | ||
22 | *) AC_MSG_ERROR([Linux only, dude!]);; | ||
23 | esac | ||
24 | |||
25 | -- | ||
26 | 2.12.1 | ||
27 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch new file mode 100644 index 000000000..cf3a84135 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From b142da8d2c9e2e2dfbe4e89e680dd124f6064ac8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pablo Neira Ayuso <pablo@netfilter.org> | ||
3 | Date: Mon, 3 Feb 2014 12:09:29 +0100 | ||
4 | Subject: [PATCH 4/6] libnfnetlink: initialize attribute padding to resolve | ||
5 | valgrind warnings | ||
6 | |||
7 | ==12195== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) | ||
8 | ==12195== at 0x51209C3: __sendto_nocancel (syscall-template.S:81) | ||
9 | ==12195== by 0x53E4D12: nfnl_send (libnfnetlink.c:391) | ||
10 | ==12195== by 0x53E6952: nfnl_query (libnfnetlink.c:1569) | ||
11 | ==12195== by 0x4E344AF: __build_send_cfg_msg.isra.1 (libnetfilter_log.c:143) | ||
12 | ==12195== by 0x4E34710: nflog_bind_group (libnetfilter_log.c:413) | ||
13 | ==12195== by 0x400CB1: main (nfulnl_test.c:77) | ||
14 | ==12195== Address 0x7fefff3e9 is on thread 1's stack | ||
15 | |||
16 | This patch sets to zero the padding that is included to align the | ||
17 | attribute payload. | ||
18 | |||
19 | Reported-by: Ivan Homoliak <xhomol11@gmail.com> | ||
20 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
21 | --- | ||
22 | src/libnfnetlink.c | 1 + | ||
23 | 1 file changed, 1 insertion(+) | ||
24 | |||
25 | diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c | ||
26 | index 4b2bcd0..398b7d7 100644 | ||
27 | --- a/src/libnfnetlink.c | ||
28 | +++ b/src/libnfnetlink.c | ||
29 | @@ -809,6 +809,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, | ||
30 | nfa->nfa_type = type; | ||
31 | nfa->nfa_len = len; | ||
32 | memcpy(NFA_DATA(nfa), data, alen); | ||
33 | + memset((uint8_t *)nfa + nfa->nfa_len, 0, NFA_ALIGN(alen) - alen); | ||
34 | n->nlmsg_len = (NLMSG_ALIGN(n->nlmsg_len) + NFA_ALIGN(len)); | ||
35 | return 0; | ||
36 | } | ||
37 | -- | ||
38 | 2.12.1 | ||
39 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch new file mode 100644 index 000000000..383f0e8b3 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | From b10c90a61a5fc46f2be5aeecb9c96e84178f7717 Mon Sep 17 00:00:00 2001 | ||
2 | From: Felix Janda <felix.janda@posteo.de> | ||
3 | Date: Sat, 16 May 2015 14:49:07 +0200 | ||
4 | Subject: [PATCH 5/6] include: Sync with kernel headers | ||
5 | |||
6 | Signed-off-by: Felix Janda <felix.janda@posteo.de> | ||
7 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
8 | --- | ||
9 | include/libnfnetlink/linux_nfnetlink.h | 44 ++++----------------------- | ||
10 | include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++---- | ||
11 | 2 files changed, 12 insertions(+), 44 deletions(-) | ||
12 | |||
13 | diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h | ||
14 | index 76a8550..44a38d6 100644 | ||
15 | --- a/include/libnfnetlink/linux_nfnetlink.h | ||
16 | +++ b/include/libnfnetlink/linux_nfnetlink.h | ||
17 | @@ -25,9 +25,9 @@ enum nfnetlink_groups { | ||
18 | /* General form of address family dependent message. | ||
19 | */ | ||
20 | struct nfgenmsg { | ||
21 | - u_int8_t nfgen_family; /* AF_xxx */ | ||
22 | - u_int8_t version; /* nfnetlink version */ | ||
23 | - u_int16_t res_id; /* resource id */ | ||
24 | + __u8 nfgen_family; /* AF_xxx */ | ||
25 | + __u8 version; /* nfnetlink version */ | ||
26 | + __be16 res_id; /* resource id */ | ||
27 | }; | ||
28 | |||
29 | #define NFNETLINK_V0 0 | ||
30 | @@ -46,40 +46,8 @@ struct nfgenmsg { | ||
31 | #define NFNL_SUBSYS_CTNETLINK_EXP 2 | ||
32 | #define NFNL_SUBSYS_QUEUE 3 | ||
33 | #define NFNL_SUBSYS_ULOG 4 | ||
34 | -#define NFNL_SUBSYS_COUNT 5 | ||
35 | +#define NFNL_SUBSYS_OSF 5 | ||
36 | +#define NFNL_SUBSYS_IPSET 6 | ||
37 | +#define NFNL_SUBSYS_COUNT 7 | ||
38 | |||
39 | -#ifdef __KERNEL__ | ||
40 | - | ||
41 | -#include <linux/netlink.h> | ||
42 | -#include <linux/capability.h> | ||
43 | -#include <net/netlink.h> | ||
44 | - | ||
45 | -struct nfnl_callback | ||
46 | -{ | ||
47 | - int (*call)(struct sock *nl, struct sk_buff *skb, | ||
48 | - struct nlmsghdr *nlh, struct nlattr *cda[]); | ||
49 | - const struct nla_policy *policy; /* netlink attribute policy */ | ||
50 | - const u_int16_t attr_count; /* number of nlattr's */ | ||
51 | -}; | ||
52 | - | ||
53 | -struct nfnetlink_subsystem | ||
54 | -{ | ||
55 | - const char *name; | ||
56 | - __u8 subsys_id; /* nfnetlink subsystem ID */ | ||
57 | - __u8 cb_count; /* number of callbacks */ | ||
58 | - const struct nfnl_callback *cb; /* callback for individual types */ | ||
59 | -}; | ||
60 | - | ||
61 | -extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); | ||
62 | -extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | ||
63 | - | ||
64 | -extern int nfnetlink_has_listeners(unsigned int group); | ||
65 | -extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | ||
66 | - int echo); | ||
67 | -extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | ||
68 | - | ||
69 | -#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | ||
70 | - MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | ||
71 | - | ||
72 | -#endif /* __KERNEL__ */ | ||
73 | #endif /* _NFNETLINK_H */ | ||
74 | diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h | ||
75 | index e145176..74b9e55 100644 | ||
76 | --- a/include/libnfnetlink/linux_nfnetlink_compat.h | ||
77 | +++ b/include/libnfnetlink/linux_nfnetlink_compat.h | ||
78 | @@ -1,6 +1,8 @@ | ||
79 | #ifndef _NFNETLINK_COMPAT_H | ||
80 | #define _NFNETLINK_COMPAT_H | ||
81 | -#ifndef __KERNEL__ | ||
82 | + | ||
83 | +#include <linux/types.h> | ||
84 | + | ||
85 | /* Old nfnetlink macros for userspace */ | ||
86 | |||
87 | /* nfnetlink groups: Up to 32 maximum */ | ||
88 | @@ -18,10 +20,9 @@ | ||
89 | * ! nfnetlink use the same attributes methods. - J. Schulist. | ||
90 | */ | ||
91 | |||
92 | -struct nfattr | ||
93 | -{ | ||
94 | - u_int16_t nfa_len; | ||
95 | - u_int16_t nfa_type; /* we use 15 bits for the type, and the highest | ||
96 | +struct nfattr { | ||
97 | + __u16 nfa_len; | ||
98 | + __u16 nfa_type; /* we use 15 bits for the type, and the highest | ||
99 | * bit to indicate whether the payload is nested */ | ||
100 | }; | ||
101 | |||
102 | @@ -57,5 +58,4 @@ struct nfattr | ||
103 | + NLMSG_ALIGN(sizeof(struct nfgenmsg)))) | ||
104 | #define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg)) | ||
105 | |||
106 | -#endif /* ! __KERNEL__ */ | ||
107 | #endif /* _NFNETLINK_COMPAT_H */ | ||
108 | -- | ||
109 | 2.12.1 | ||
110 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch new file mode 100644 index 000000000..72c9987d1 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch | |||
@@ -0,0 +1,403 @@ | |||
1 | From 5cb589e246c91331ee6b3926b15f5e6cfc8ad95e Mon Sep 17 00:00:00 2001 | ||
2 | From: Felix Janda <felix.janda@posteo.de> | ||
3 | Date: Sat, 16 May 2015 14:59:57 +0200 | ||
4 | Subject: [PATCH 6/6] src: Use stdint types everywhere | ||
5 | |||
6 | Signed-off-by: Felix Janda <felix.janda@posteo.de> | ||
7 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
8 | --- | ||
9 | include/libnfnetlink/libnfnetlink.h | 25 ++++++------- | ||
10 | src/iftable.c | 8 ++--- | ||
11 | src/iftable.h | 4 +-- | ||
12 | src/libnfnetlink.c | 72 ++++++++++++++++++------------------- | ||
13 | src/rtnl.c | 4 +-- | ||
14 | src/rtnl.h | 2 +- | ||
15 | 6 files changed, 58 insertions(+), 57 deletions(-) | ||
16 | |||
17 | diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h | ||
18 | index 1d8c49d..cd0be3d 100644 | ||
19 | --- a/include/libnfnetlink/libnfnetlink.h | ||
20 | +++ b/include/libnfnetlink/libnfnetlink.h | ||
21 | @@ -15,6 +15,7 @@ | ||
22 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) | ||
23 | #endif | ||
24 | |||
25 | +#include <stdint.h> | ||
26 | #include <sys/socket.h> /* for sa_family_t */ | ||
27 | #include <linux/netlink.h> | ||
28 | #include <libnfnetlink/linux_nfnetlink.h> | ||
29 | @@ -55,7 +56,7 @@ struct nfnlhdr { | ||
30 | struct nfnl_callback { | ||
31 | int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data); | ||
32 | void *data; | ||
33 | - u_int16_t attr_count; | ||
34 | + uint16_t attr_count; | ||
35 | }; | ||
36 | |||
37 | struct nfnl_handle; | ||
38 | @@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void); | ||
39 | extern int nfnl_close(struct nfnl_handle *); | ||
40 | |||
41 | extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *, | ||
42 | - u_int8_t, u_int8_t, | ||
43 | + uint8_t, uint8_t, | ||
44 | unsigned int); | ||
45 | extern void nfnl_subsys_close(struct nfnl_subsys_handle *); | ||
46 | |||
47 | @@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh, | ||
48 | const struct iovec *iov, unsigned int num, | ||
49 | unsigned int flags); | ||
50 | extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *, | ||
51 | - unsigned int, u_int8_t, u_int16_t, u_int16_t, | ||
52 | - u_int16_t); | ||
53 | + unsigned int, uint8_t, uint16_t, uint16_t, | ||
54 | + uint16_t); | ||
55 | extern __attribute__((deprecated)) int | ||
56 | nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t, | ||
57 | unsigned, struct nlmsghdr *, | ||
58 | @@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *, | ||
59 | /* receiving */ | ||
60 | extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len); | ||
61 | extern int nfnl_callback_register(struct nfnl_subsys_handle *, | ||
62 | - u_int8_t type, struct nfnl_callback *cb); | ||
63 | -extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type); | ||
64 | + uint8_t type, struct nfnl_callback *cb); | ||
65 | +extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type); | ||
66 | extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len); | ||
67 | |||
68 | /* parsing */ | ||
69 | @@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh); | ||
70 | |||
71 | /* nfnl attribute handling functions */ | ||
72 | extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int); | ||
73 | -extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t); | ||
74 | -extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t); | ||
75 | -extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t); | ||
76 | +extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t); | ||
77 | +extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t); | ||
78 | +extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t); | ||
79 | extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int); | ||
80 | -extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t); | ||
81 | -extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t); | ||
82 | +extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t); | ||
83 | +extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t); | ||
84 | extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int); | ||
85 | #define nfnl_parse_nested(tb, max, nfa) \ | ||
86 | nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa))) | ||
87 | @@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int); | ||
88 | ({ (tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; }) | ||
89 | |||
90 | extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, | ||
91 | - u_int16_t type, u_int32_t len, | ||
92 | + uint16_t type, uint32_t len, | ||
93 | unsigned char *val); | ||
94 | extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h, | ||
95 | unsigned int size); | ||
96 | diff --git a/src/iftable.c b/src/iftable.c | ||
97 | index 5976ed8..157f97b 100644 | ||
98 | --- a/src/iftable.c | ||
99 | +++ b/src/iftable.c | ||
100 | @@ -27,10 +27,10 @@ | ||
101 | struct ifindex_node { | ||
102 | struct list_head head; | ||
103 | |||
104 | - u_int32_t index; | ||
105 | - u_int32_t type; | ||
106 | - u_int32_t alen; | ||
107 | - u_int32_t flags; | ||
108 | + uint32_t index; | ||
109 | + uint32_t type; | ||
110 | + uint32_t alen; | ||
111 | + uint32_t flags; | ||
112 | char addr[8]; | ||
113 | char name[16]; | ||
114 | }; | ||
115 | diff --git a/src/iftable.h b/src/iftable.h | ||
116 | index 8df7f24..655df6b 100644 | ||
117 | --- a/src/iftable.h | ||
118 | +++ b/src/iftable.h | ||
119 | @@ -1,8 +1,8 @@ | ||
120 | #ifndef _IFTABLE_H | ||
121 | #define _IFTABLE_H | ||
122 | |||
123 | -int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif); | ||
124 | -int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif); | ||
125 | +int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif); | ||
126 | +int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif); | ||
127 | |||
128 | int iftable_init(void); | ||
129 | void iftable_fini(void); | ||
130 | diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c | ||
131 | index 398b7d7..df57533 100644 | ||
132 | --- a/src/libnfnetlink.c | ||
133 | +++ b/src/libnfnetlink.c | ||
134 | @@ -72,9 +72,9 @@ | ||
135 | |||
136 | struct nfnl_subsys_handle { | ||
137 | struct nfnl_handle *nfnlh; | ||
138 | - u_int32_t subscriptions; | ||
139 | - u_int8_t subsys_id; | ||
140 | - u_int8_t cb_count; | ||
141 | + uint32_t subscriptions; | ||
142 | + uint8_t subsys_id; | ||
143 | + uint8_t cb_count; | ||
144 | struct nfnl_callback *cb; /* array of callbacks */ | ||
145 | }; | ||
146 | |||
147 | @@ -86,11 +86,11 @@ struct nfnl_handle { | ||
148 | int fd; | ||
149 | struct sockaddr_nl local; | ||
150 | struct sockaddr_nl peer; | ||
151 | - u_int32_t subscriptions; | ||
152 | - u_int32_t seq; | ||
153 | - u_int32_t dump; | ||
154 | - u_int32_t rcv_buffer_size; /* for nfnl_catch */ | ||
155 | - u_int32_t flags; | ||
156 | + uint32_t subscriptions; | ||
157 | + uint32_t seq; | ||
158 | + uint32_t dump; | ||
159 | + uint32_t rcv_buffer_size; /* for nfnl_catch */ | ||
160 | + uint32_t flags; | ||
161 | struct nlmsghdr *last_nlhdr; | ||
162 | struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1]; | ||
163 | }; | ||
164 | @@ -145,7 +145,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h) | ||
165 | static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh) | ||
166 | { | ||
167 | int i, err; | ||
168 | - u_int32_t new_subscriptions = nfnlh->subscriptions; | ||
169 | + uint32_t new_subscriptions = nfnlh->subscriptions; | ||
170 | |||
171 | for (i = 0; i < NFNL_MAX_SUBSYS; i++) | ||
172 | new_subscriptions |= nfnlh->subsys[i].subscriptions; | ||
173 | @@ -273,8 +273,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size) | ||
174 | * a valid address that points to a nfnl_subsys_handle structure is returned. | ||
175 | */ | ||
176 | struct nfnl_subsys_handle * | ||
177 | -nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id, | ||
178 | - u_int8_t cb_count, u_int32_t subscriptions) | ||
179 | +nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id, | ||
180 | + uint8_t cb_count, uint32_t subscriptions) | ||
181 | { | ||
182 | struct nfnl_subsys_handle *ssh; | ||
183 | |||
184 | @@ -435,10 +435,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov, | ||
185 | */ | ||
186 | void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh, | ||
187 | struct nlmsghdr *nlh, unsigned int len, | ||
188 | - u_int8_t family, | ||
189 | - u_int16_t res_id, | ||
190 | - u_int16_t msg_type, | ||
191 | - u_int16_t msg_flags) | ||
192 | + uint8_t family, | ||
193 | + uint16_t res_id, | ||
194 | + uint16_t msg_type, | ||
195 | + uint16_t msg_flags) | ||
196 | { | ||
197 | assert(ssh); | ||
198 | assert(nlh); | ||
199 | @@ -815,7 +815,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, | ||
200 | } | ||
201 | |||
202 | /** | ||
203 | - * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr | ||
204 | + * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr | ||
205 | * | ||
206 | * @nfa: struct nfattr | ||
207 | * @maxlen: maximal length of nfattr buffer | ||
208 | @@ -849,14 +849,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type, | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | - * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr | ||
213 | + * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr | ||
214 | * | ||
215 | * @n: netlink message header to which attribute is to be added | ||
216 | * @maxlen: maximum length of netlink message header | ||
217 | * @type: type of new attribute | ||
218 | * @data: content of new attribute | ||
219 | */ | ||
220 | -int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data) | ||
221 | +int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data) | ||
222 | { | ||
223 | assert(n); | ||
224 | assert(maxlen > 0); | ||
225 | @@ -866,7 +866,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data) | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | - * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr | ||
230 | + * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr | ||
231 | * | ||
232 | * @nfa: struct nfattr | ||
233 | * @maxlen: maximal length of nfattr buffer | ||
234 | @@ -875,7 +875,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data) | ||
235 | * | ||
236 | */ | ||
237 | int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, | ||
238 | - u_int16_t data) | ||
239 | + uint16_t data) | ||
240 | { | ||
241 | assert(nfa); | ||
242 | assert(maxlen > 0); | ||
243 | @@ -885,7 +885,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, | ||
244 | } | ||
245 | |||
246 | /** | ||
247 | - * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr | ||
248 | + * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr | ||
249 | * | ||
250 | * @n: netlink message header to which attribute is to be added | ||
251 | * @maxlen: maximum length of netlink message header | ||
252 | @@ -894,7 +894,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, | ||
253 | * | ||
254 | */ | ||
255 | int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type, | ||
256 | - u_int16_t data) | ||
257 | + uint16_t data) | ||
258 | { | ||
259 | assert(n); | ||
260 | assert(maxlen > 0); | ||
261 | @@ -904,7 +904,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type, | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | - * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr | ||
266 | + * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr | ||
267 | * | ||
268 | * @nfa: struct nfattr | ||
269 | * @maxlen: maximal length of nfattr buffer | ||
270 | @@ -913,7 +913,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type, | ||
271 | * | ||
272 | */ | ||
273 | int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, | ||
274 | - u_int32_t data) | ||
275 | + uint32_t data) | ||
276 | { | ||
277 | assert(nfa); | ||
278 | assert(maxlen > 0); | ||
279 | @@ -923,7 +923,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, | ||
280 | } | ||
281 | |||
282 | /** | ||
283 | - * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr | ||
284 | + * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr | ||
285 | * | ||
286 | * @n: netlink message header to which attribute is to be added | ||
287 | * @maxlen: maximum length of netlink message header | ||
288 | @@ -932,7 +932,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, | ||
289 | * | ||
290 | */ | ||
291 | int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type, | ||
292 | - u_int32_t data) | ||
293 | + uint32_t data) | ||
294 | { | ||
295 | assert(n); | ||
296 | assert(maxlen > 0); | ||
297 | @@ -980,7 +980,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len) | ||
298 | * | ||
299 | */ | ||
300 | void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, | ||
301 | - u_int16_t type, u_int32_t len, unsigned char *val) | ||
302 | + uint16_t type, uint32_t len, unsigned char *val) | ||
303 | { | ||
304 | assert(iov); | ||
305 | assert(nfa); | ||
306 | @@ -1115,7 +1115,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h, | ||
307 | * appropiately. | ||
308 | */ | ||
309 | int nfnl_callback_register(struct nfnl_subsys_handle *ssh, | ||
310 | - u_int8_t type, struct nfnl_callback *cb) | ||
311 | + uint8_t type, struct nfnl_callback *cb) | ||
312 | { | ||
313 | assert(ssh); | ||
314 | assert(cb); | ||
315 | @@ -1138,7 +1138,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh, | ||
316 | * On sucess, 0 is returned. On error, -1 is returned and errno is | ||
317 | * set appropiately. | ||
318 | */ | ||
319 | -int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type) | ||
320 | +int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type) | ||
321 | { | ||
322 | assert(ssh); | ||
323 | |||
324 | @@ -1161,8 +1161,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h, | ||
325 | assert(nfa); | ||
326 | |||
327 | int min_len; | ||
328 | - u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
329 | - u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
330 | + uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
331 | + uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
332 | const struct nfnl_subsys_handle *ssh; | ||
333 | struct nfnl_callback *cb; | ||
334 | |||
335 | @@ -1212,8 +1212,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh, | ||
336 | int len) | ||
337 | { | ||
338 | struct nfnl_subsys_handle *ssh; | ||
339 | - u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
340 | - u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
341 | + uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
342 | + uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
343 | int err = 0; | ||
344 | |||
345 | if (subsys_id > NFNL_MAX_SUBSYS) | ||
346 | @@ -1243,7 +1243,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len) | ||
347 | { | ||
348 | |||
349 | while (len >= NLMSG_SPACE(0)) { | ||
350 | - u_int32_t rlen; | ||
351 | + uint32_t rlen; | ||
352 | struct nlmsghdr *nlh = (struct nlmsghdr *)buf; | ||
353 | |||
354 | if (nlh->nlmsg_len < sizeof(struct nlmsghdr) | ||
355 | @@ -1285,8 +1285,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh) | ||
356 | static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh) | ||
357 | { | ||
358 | struct nfnl_subsys_handle *ssh; | ||
359 | - u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
360 | - u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
361 | + uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type); | ||
362 | + uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type); | ||
363 | |||
364 | /* Is this an error message? */ | ||
365 | if (nfnl_is_error(h, nlh)) { | ||
366 | diff --git a/src/rtnl.c b/src/rtnl.c | ||
367 | index 7b4ac7d..284eecd 100644 | ||
368 | --- a/src/rtnl.c | ||
369 | +++ b/src/rtnl.c | ||
370 | @@ -30,7 +30,7 @@ | ||
371 | #define rtnl_log(x, ...) | ||
372 | |||
373 | static inline struct rtnl_handler * | ||
374 | -find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type) | ||
375 | +find_handler(struct rtnl_handle *rtnl_handle, uint16_t type) | ||
376 | { | ||
377 | struct rtnl_handler *h; | ||
378 | for (h = rtnl_handle->handlers; h; h = h->next) { | ||
379 | @@ -41,7 +41,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type) | ||
380 | } | ||
381 | |||
382 | static int call_handler(struct rtnl_handle *rtnl_handle, | ||
383 | - u_int16_t type, | ||
384 | + uint16_t type, | ||
385 | struct nlmsghdr *hdr) | ||
386 | { | ||
387 | struct rtnl_handler *h = find_handler(rtnl_handle, type); | ||
388 | diff --git a/src/rtnl.h b/src/rtnl.h | ||
389 | index 0c403dc..2cb22a8 100644 | ||
390 | --- a/src/rtnl.h | ||
391 | +++ b/src/rtnl.h | ||
392 | @@ -7,7 +7,7 @@ | ||
393 | struct rtnl_handler { | ||
394 | struct rtnl_handler *next; | ||
395 | |||
396 | - u_int16_t nlmsg_type; | ||
397 | + uint16_t nlmsg_type; | ||
398 | int (*handlefn)(struct nlmsghdr *h, void *arg); | ||
399 | void *arg; | ||
400 | }; | ||
401 | -- | ||
402 | 2.12.1 | ||
403 | |||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb index edd0f866f..f7951ff8d 100644 --- a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb | |||
@@ -11,7 +11,14 @@ LICENSE = "GPLv2+" | |||
11 | 11 | ||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" |
13 | 13 | ||
14 | SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar" | 14 | SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar \ |
15 | file://0001-build-resolve-automake-1.12-warnings.patch \ | ||
16 | file://0002-src-get-source-code-license-header-in-sync-with-curr.patch \ | ||
17 | file://0003-configure-uclinux-is-also-linux.patch \ | ||
18 | file://0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch \ | ||
19 | file://0005-include-Sync-with-kernel-headers.patch \ | ||
20 | file://0006-src-Use-stdint-types-everywhere.patch \ | ||
21 | " | ||
15 | SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e" | 22 | SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e" |
16 | SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" | 23 | SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" |
17 | 24 | ||