summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-filter
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-03-26 14:21:31 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-04-25 15:55:35 -0400
commit2cc844809fbc64dbdc2c2cd3f6b11467bbed85c3 (patch)
tree4d8f02898c41b6d24902d68d870385942648739c /meta-networking/recipes-filter
parent729eae7490858b0f4b4231b318722c845d4fd3c1 (diff)
downloadmeta-openembedded-2cc844809fbc64dbdc2c2cd3f6b11467bbed85c3.tar.gz
ebtables: Fix build with musl
Backport upstream fixes and add fixes to make it work with musl 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')
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch45
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch25
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch25
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch28
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch75
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch69
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch67
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch48
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch48
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch216
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb12
11 files changed, 657 insertions, 1 deletions
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
new file mode 100644
index 000000000..90b69792b
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
@@ -0,0 +1,45 @@
1From dd35afc9ce1004128a754d5eeb8c5c2cb32ae420 Mon Sep 17 00:00:00 2001
2From: Bart De Schuymer <bdschuym@pandora.be>
3Date: Tue, 3 Jul 2012 18:47:32 +0000
4Subject: [PATCH 01/10] add RARP and update iana url
5
6---
7 ethertypes | 10 ++++++----
8 1 file changed, 6 insertions(+), 4 deletions(-)
9
10diff --git a/ethertypes b/ethertypes
11index 5e700f6..813177b 100644
12--- a/ethertypes
13+++ b/ethertypes
14@@ -5,6 +5,7 @@
15 #
16 # This list could be found on:
17 # http://www.iana.org/assignments/ethernet-numbers
18+# http://www.iana.org/assignments/ieee-802-numbers
19 #
20 # <name> <hexnumber> <alias1>...<alias35> #Comment
21 #
22@@ -21,15 +22,16 @@ LAT 6004 # DEC LAT
23 DIAG 6005 # DEC Diagnostics
24 CUST 6006 # DEC Customer use
25 SCA 6007 # DEC Systems Comms Arch
26-TEB 6558 # Trans Ether Bridging [RFC1701]
27-RAW_FR 6559 # Raw Frame Relay [RFC1701]
28+TEB 6558 # Trans Ether Bridging [RFC1701]
29+RAW_FR 6559 # Raw Frame Relay [RFC1701]
30+RARP 8035 # Reverse ARP [RFC903]
31 AARP 80F3 # Appletalk AARP
32-ATALK 809B # Appletalk
33+ATALK 809B # Appletalk
34 802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame
35 IPX 8137 # Novell IPX
36 NetBEUI 8191 # NetBEUI
37 IPv6 86DD ip6 # IP version 6
38-PPP 880B # PPP
39+PPP 880B # PPP
40 ATMMPOA 884C # MultiProtocol over ATM
41 PPP_DISC 8863 # PPPoE discovery messages
42 PPP_SES 8864 # PPPoE session messages
43--
442.12.1
45
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
new file mode 100644
index 000000000..87b0e9b87
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
@@ -0,0 +1,25 @@
1From 2a5333fc8b4825251adfb717d980d89cefde38d6 Mon Sep 17 00:00:00 2001
2From: Petri Gynther <petri.gynther@gmail.com>
3Date: Sun, 24 Feb 2013 10:56:59 +0100
4Subject: [PATCH 02/10] fix compilation warning
5
6---
7 communication.c | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
9
10diff --git a/communication.c b/communication.c
11index 62ed667..ba058c0 100644
12--- a/communication.c
13+++ b/communication.c
14@@ -282,7 +282,7 @@ static int store_counters_in_file(char *filename, struct ebt_u_replace *repl)
15 }
16 close_file:
17 fclose(file);
18- return 0;
19+ return ret;
20 }
21
22 /* Gets executed after ebt_deliver_table. Delivers the counters to the kernel
23--
242.12.1
25
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
new file mode 100644
index 000000000..c8573a464
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
@@ -0,0 +1,25 @@
1From a6faf3b50d6af4768b7b853cb536944fb18e1450 Mon Sep 17 00:00:00 2001
2From: Bart De Schuymer <bdschuym@pandora.be>
3Date: Wed, 3 Jul 2013 22:12:47 +0200
4Subject: [PATCH 03/10] add info about -Wl,-no-as-needed
5
6---
7 INSTALL | 2 ++
8 1 file changed, 2 insertions(+)
9
10diff --git a/INSTALL b/INSTALL
11index 4a05c67..e90d5c1 100644
12--- a/INSTALL
13+++ b/INSTALL
14@@ -39,6 +39,8 @@ That's all
15 You can also use a base directory different from the root directory (/),
16 using the DESTDIR option. See the Makefile for more details.
17
18+You might need to set LDFLAGS=-Wl,-no-as-needed to build ebtables correctly
19+on your system.
20
21 ADDITIONAL PROGRAMS:
22 ----------------------
23--
242.12.1
25
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
new file mode 100644
index 000000000..d8f2795bc
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
@@ -0,0 +1,28 @@
1From b0617af37b8b1aafb43e8019135bea44c2d94c28 Mon Sep 17 00:00:00 2001
2From: Luis Fernando <tdthp@terra.com.br>
3Date: Wed, 3 Jul 2013 22:19:55 +0200
4Subject: [PATCH 04/10] workaround for kernel regression bug: IPv6
5 source/destination addresses are potentially not matched correctly
6
7---
8 extensions/ebt_ip6.c | 4 ++++
9 1 file changed, 4 insertions(+)
10
11diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
12index 0465e77..bbdc4ae 100644
13--- a/extensions/ebt_ip6.c
14+++ b/extensions/ebt_ip6.c
15@@ -312,6 +312,10 @@ static void init(struct ebt_entry_match *match)
16
17 ipinfo->invflags = 0;
18 ipinfo->bitmask = 0;
19+ memset(ipinfo->saddr.s6_addr, 0, sizeof(ipinfo->saddr.s6_addr));
20+ memset(ipinfo->smsk.s6_addr, 0, sizeof(ipinfo->smsk.s6_addr));
21+ memset(ipinfo->daddr.s6_addr, 0, sizeof(ipinfo->daddr.s6_addr));
22+ memset(ipinfo->dmsk.s6_addr, 0, sizeof(ipinfo->dmsk.s6_addr));
23 }
24
25 #define OPT_SOURCE 0x01
26--
272.12.1
28
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
new file mode 100644
index 000000000..9585fd20e
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
@@ -0,0 +1,75 @@
1From 15d3ab8a4a167dc44396b003d2ec01841949972f Mon Sep 17 00:00:00 2001
2From: Sanket Shah <sanket.shah@cyberoam.com>
3Date: Wed, 31 Jul 2013 21:40:08 +0200
4Subject: [PATCH 05/10] Add --noflush command line support for ebtables-restore
5
6---
7 ebtables-restore.c | 29 +++++++++++++++++++++++++----
8 1 file changed, 25 insertions(+), 4 deletions(-)
9
10diff --git a/ebtables-restore.c b/ebtables-restore.c
11index ea02960..bb4d0cf 100644
12--- a/ebtables-restore.c
13+++ b/ebtables-restore.c
14@@ -22,13 +22,25 @@
15 #include <string.h>
16 #include <errno.h>
17 #include <unistd.h>
18+#include <getopt.h>
19 #include "include/ebtables_u.h"
20
21+static const struct option options[] = {
22+ {.name = "noflush", .has_arg = 0, .val = 'n'},
23+ { 0 }
24+};
25+
26 static struct ebt_u_replace replace[3];
27 void ebt_early_init_once();
28
29 #define OPT_KERNELDATA 0x800 /* Also defined in ebtables.c */
30
31+static void print_usage()
32+{
33+ fprintf(stderr, "Usage: ebtables-restore [ --noflush ]\n");
34+ exit(1);
35+}
36+
37 static void copy_table_names()
38 {
39 strcpy(replace[0].name, "filter");
40@@ -41,11 +53,20 @@ static void copy_table_names()
41 int main(int argc_, char *argv_[])
42 {
43 char *argv[EBTD_ARGC_MAX], cmdline[EBTD_CMDLINE_MAXLN];
44- int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace;
45+ int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace, c, flush = 1;
46 char ebtables_str[] = "ebtables";
47
48- if (argc_ != 1)
49- ebtrest_print_error("options are not supported");
50+ while ((c = getopt_long(argc_, argv_, "n", options, NULL)) != -1) {
51+ switch(c) {
52+ case 'n':
53+ flush = 0;
54+ break;
55+ default:
56+ print_usage();
57+ break;
58+ }
59+ }
60+
61 ebt_silent = 0;
62 copy_table_names();
63 ebt_early_init_once();
64@@ -68,7 +89,7 @@ int main(int argc_, char *argv_[])
65 ebtrest_print_error("table '%s' was not recognized", cmdline+1);
66 table_nr = i;
67 replace[table_nr].command = 11;
68- ebt_get_kernel_table(&replace[table_nr], 1);
69+ ebt_get_kernel_table(&replace[table_nr], flush);
70 replace[table_nr].command = 0;
71 replace[table_nr].flags = OPT_KERNELDATA; /* Prevent do_command from initialising replace */
72 continue;
73--
742.12.1
75
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
new file mode 100644
index 000000000..21f8e588d
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
@@ -0,0 +1,69 @@
1From 85a0f6d77a9d5c0e7ef7948395f0f6b1612dc987 Mon Sep 17 00:00:00 2001
2From: Bart De Schuymer <bdschuym@pandora.be>
3Date: Mon, 14 Apr 2014 22:04:55 +0200
4Subject: [PATCH 06/10] don't print IPv6 mask if it's all ones (based on patch
5 by Mariusz Mazur <mmazur at axeos.com>)
6
7---
8 extensions/ebt_ip6.c | 4 ++--
9 include/ebtables_u.h | 1 +
10 useful_functions.c | 13 +++++++++++++
11 3 files changed, 16 insertions(+), 2 deletions(-)
12
13diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
14index bbdc4ae..e3e0956 100644
15--- a/extensions/ebt_ip6.c
16+++ b/extensions/ebt_ip6.c
17@@ -449,14 +449,14 @@ static void print(const struct ebt_u_entry *entry,
18 if (ipinfo->invflags & EBT_IP6_SOURCE)
19 printf("! ");
20 printf("%s", ebt_ip6_to_numeric(&ipinfo->saddr));
21- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->smsk));
22+ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->smsk));
23 }
24 if (ipinfo->bitmask & EBT_IP6_DEST) {
25 printf("--ip6-dst ");
26 if (ipinfo->invflags & EBT_IP6_DEST)
27 printf("! ");
28 printf("%s", ebt_ip6_to_numeric(&ipinfo->daddr));
29- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->dmsk));
30+ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->dmsk));
31 }
32 if (ipinfo->bitmask & EBT_IP6_TCLASS) {
33 printf("--ip6-tclass ");
34diff --git a/include/ebtables_u.h b/include/ebtables_u.h
35index ab615c1..35a5bcc 100644
36--- a/include/ebtables_u.h
37+++ b/include/ebtables_u.h
38@@ -303,6 +303,7 @@ char *ebt_mask_to_dotted(uint32_t mask);
39 void ebt_parse_ip6_address(char *address, struct in6_addr *addr,
40 struct in6_addr *msk);
41 char *ebt_ip6_to_numeric(const struct in6_addr *addrp);
42+char *ebt_ip6_mask_to_string(const struct in6_addr *msk);
43
44
45 int do_command(int argc, char *argv[], int exec_style,
46diff --git a/useful_functions.c b/useful_functions.c
47index d20b68e..d14cbe9 100644
48--- a/useful_functions.c
49+++ b/useful_functions.c
50@@ -411,3 +411,16 @@ char *ebt_ip6_to_numeric(const struct in6_addr *addrp)
51 static char buf[50+1];
52 return (char *)inet_ntop(AF_INET6, addrp, buf, sizeof(buf));
53 }
54+
55+char *ebt_ip6_mask_to_string(const struct in6_addr *msk)
56+{
57+ /* /0000:0000:0000:0000:0000:000.000.000.000
58+ * /0000:0000:0000:0000:0000:0000:0000:0000 */
59+ static char buf[51+1];
60+ if (msk->s6_addr32[0] == 0xFFFFFFFFL && msk->s6_addr32[1] == 0xFFFFFFFFL &&
61+ msk->s6_addr32[2] == 0xFFFFFFFFL && msk->s6_addr32[3] == 0xFFFFFFFFL)
62+ *buf = '\0';
63+ else
64+ sprintf(buf, "/%s", ebt_ip6_to_numeric(msk));
65+ return buf;
66+}
67--
682.12.1
69
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
new file mode 100644
index 000000000..6fbe7df4c
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
@@ -0,0 +1,67 @@
1From a60c7d4a6d05387aceb8ae9c38390d0f9bae84a2 Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sat, 16 May 2015 12:22:39 +0200
4Subject: [PATCH 07/10] extensions: Use stdint types
5
6Signed-off-by: Felix Janda <felix.janda@posteo.de>
7Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8---
9 extensions/ebt_ip6.c | 4 ++--
10 extensions/ebt_limit.c | 10 +++++-----
11 2 files changed, 7 insertions(+), 7 deletions(-)
12
13diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
14index e3e0956..dd48547 100644
15--- a/extensions/ebt_ip6.c
16+++ b/extensions/ebt_ip6.c
17@@ -53,8 +53,8 @@ static const struct option opts[] =
18
19 struct icmpv6_names {
20 const char *name;
21- u_int8_t type;
22- u_int8_t code_min, code_max;
23+ uint8_t type;
24+ uint8_t code_min, code_max;
25 };
26
27 static const struct icmpv6_names icmpv6_codes[] = {
28diff --git a/extensions/ebt_limit.c b/extensions/ebt_limit.c
29index ee40e5c..d189a09 100644
30--- a/extensions/ebt_limit.c
31+++ b/extensions/ebt_limit.c
32@@ -59,11 +59,11 @@ static void print_help(void)
33 " default %u\n", EBT_LIMIT_BURST);
34 }
35
36-static int parse_rate(const char *rate, u_int32_t *val)
37+static int parse_rate(const char *rate, uint32_t *val)
38 {
39 const char *delim;
40- u_int32_t r;
41- u_int32_t mult = 1; /* Seconds by default. */
42+ uint32_t r;
43+ uint32_t mult = 1; /* Seconds by default. */
44
45 delim = strchr(rate, '/');
46 if (delim) {
47@@ -151,7 +151,7 @@ static void final_check(const struct ebt_u_entry *entry,
48 struct rates
49 {
50 const char *name;
51- u_int32_t mult;
52+ uint32_t mult;
53 };
54
55 static struct rates g_rates[] =
56@@ -162,7 +162,7 @@ static struct rates g_rates[] =
57 { "sec", EBT_LIMIT_SCALE }
58 };
59
60-static void print_rate(u_int32_t period)
61+static void print_rate(uint32_t period)
62 {
63 unsigned int i;
64
65--
662.12.1
67
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
new file mode 100644
index 000000000..df3f52143
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
@@ -0,0 +1,48 @@
1From 6ed23c8c2bc5efc3956e7bb6155afc8f45e6ae1a Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sat, 16 May 2015 12:31:58 +0200
4Subject: [PATCH 08/10] ethernetdb.h: Remove C++ specific compiler hint macro
5 _THROW
6
7Fixes compilation with musl libc
8
9Signed-off-by: Felix Janda <felix.janda@posteo.de>
10Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11---
12 include/ethernetdb.h | 11 +++++------
13 1 file changed, 5 insertions(+), 6 deletions(-)
14
15diff --git a/include/ethernetdb.h b/include/ethernetdb.h
16index 46d8bfd..1683abe 100644
17--- a/include/ethernetdb.h
18+++ b/include/ethernetdb.h
19@@ -38,21 +38,20 @@ struct ethertypeent {
20
21 /* Open ethertype data base files and mark them as staying open even
22 after a later search if STAY_OPEN is non-zero. */
23-extern void setethertypeent(int __stay_open) __THROW;
24+extern void setethertypeent(int __stay_open);
25
26 /* Close ethertype data base files and clear `stay open' flag. */
27-extern void endethertypeent(void) __THROW;
28+extern void endethertypeent(void);
29
30 /* Get next entry from ethertype data base file. Open data base if
31 necessary. */
32-extern struct ethertypeent *getethertypeent(void) __THROW;
33+extern struct ethertypeent *getethertypeent(void);
34
35 /* Return entry from ethertype data base for network with NAME. */
36-extern struct ethertypeent *getethertypebyname(__const char *__name)
37- __THROW;
38+extern struct ethertypeent *getethertypebyname(__const char *__name);
39
40 /* Return entry from ethertype data base which number is PROTO. */
41-extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW;
42+extern struct ethertypeent *getethertypebynumber(int __ethertype);
43
44
45 #endif /* ethernetdb.h */
46--
472.12.1
48
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
new file mode 100644
index 000000000..248582c18
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
@@ -0,0 +1,48 @@
1From e6b367c0c2668341c47242d099f4d2048ae575ef Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Alin=20N=C4=83stac?= <alin.nastac@gmail.com>
3Date: Thu, 22 Oct 2015 16:41:03 +0200
4Subject: [PATCH 09/10] ebtables: Allow RETURN target rules in user defined
5 chains
6
7During loop checking ebtables marks entries with '1 << NF_BR_NUMHOOKS' if
8they're called from a base chain rather than a user defined chain.
9
10This can be used by ebtables targets that can encode a special return
11value to bail out if e.g. RETURN is used from a base chain.
12
13Unfortunately, this is broken, since the '1 << NF_BR_NUMHOOKS' is also
14copied to called user-defined-chains (i.e., a user defined chain can no
15longer be distinguished from a base chain):
16
17root@OpenWrt:~# ebtables -N foo
18root@OpenWrt:~# ebtables -A OUTPUT -j foo
19root@OpenWrt:~# ebtables -A foo -j mark --mark-or 3 --mark-target RETURN
20--mark-target RETURN not allowed on base chain.
21
22This works if -A OUTPUT -j foo is omitted, but will still appear
23if we try to call foo from OUTPUT afterwards.
24
25After this patch we still reject
26'-A OUTPUT -j mark .. --mark-target RETURN'.
27
28Signed-off-by: Florian Westphal <fw@strlen.de>
29---
30 libebtc.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33diff --git a/libebtc.c b/libebtc.c
34index 17ba8f2..74830ec 100644
35--- a/libebtc.c
36+++ b/libebtc.c
37@@ -1102,7 +1102,7 @@ void ebt_check_for_loops(struct ebt_u_replace *replace)
38 /* check if we've dealt with this chain already */
39 if (entries2->hook_mask & (1<<i))
40 goto letscontinue;
41- entries2->hook_mask |= entries->hook_mask;
42+ entries2->hook_mask |= entries->hook_mask & ~(1 << NF_BR_NUMHOOKS);
43 /* Jump to the chain, make sure we know how to get back */
44 stack[sp].chain_nr = chain_nr;
45 stack[sp].n = j;
46--
472.12.1
48
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
new file mode 100644
index 000000000..a6ef9cd09
--- /dev/null
+++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
@@ -0,0 +1,216 @@
1From b7cee37734007fced7a4d5ed586c3a9e5ad92878 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 26 Mar 2017 13:12:21 -0700
4Subject: [PATCH 10/10] Adjust header include sequence
5
6This fixes the build with musl
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 extensions/ebt_among.c | 2 +-
11 extensions/ebt_arpreply.c | 2 +-
12 extensions/ebt_nat.c | 2 +-
13 include/linux/if_ether.h | 126 ----------------------------------------------
14 useful_functions.c | 4 +-
15 5 files changed, 5 insertions(+), 131 deletions(-)
16 delete mode 100644 include/linux/if_ether.h
17
18diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
19index f97d07e..b096847 100644
20--- a/extensions/ebt_among.c
21+++ b/extensions/ebt_among.c
22@@ -12,8 +12,8 @@
23 #include <getopt.h>
24 #include <ctype.h>
25 #include <unistd.h>
26-#include "../include/ebtables_u.h"
27 #include <netinet/ether.h>
28+#include "../include/ebtables_u.h"
29 #include "../include/ethernetdb.h"
30 #include <linux/if_ether.h>
31 #include <linux/netfilter_bridge/ebt_among.h>
32diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
33index c3757f3..c5102a4 100644
34--- a/extensions/ebt_arpreply.c
35+++ b/extensions/ebt_arpreply.c
36@@ -11,8 +11,8 @@
37 #include <stdlib.h>
38 #include <string.h>
39 #include <getopt.h>
40-#include "../include/ebtables_u.h"
41 #include <netinet/ether.h>
42+#include "../include/ebtables_u.h"
43 #include <linux/netfilter_bridge/ebt_arpreply.h>
44
45 static int mac_supplied;
46diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
47index e6afbf8..8d318d1 100644
48--- a/extensions/ebt_nat.c
49+++ b/extensions/ebt_nat.c
50@@ -10,8 +10,8 @@
51 #include <stdlib.h>
52 #include <string.h>
53 #include <getopt.h>
54-#include "../include/ebtables_u.h"
55 #include <netinet/ether.h>
56+#include "../include/ebtables_u.h"
57 #include <linux/netfilter_bridge/ebt_nat.h>
58
59 static int to_source_supplied, to_dest_supplied;
60diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
61deleted file mode 100644
62index 28a15ff..0000000
63--- a/include/linux/if_ether.h
64+++ /dev/null
65@@ -1,126 +0,0 @@
66-/*
67- * INET An implementation of the TCP/IP protocol suite for the LINUX
68- * operating system. INET is implemented using the BSD Socket
69- * interface as the means of communication with the user level.
70- *
71- * Global definitions for the Ethernet IEEE 802.3 interface.
72- *
73- * Version: @(#)if_ether.h 1.0.1a 02/08/94
74- *
75- * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
76- * Donald Becker, <becker@super.org>
77- * Alan Cox, <alan@lxorguk.ukuu.org.uk>
78- * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
79- *
80- * This program is free software; you can redistribute it and/or
81- * modify it under the terms of the GNU General Public License
82- * as published by the Free Software Foundation; either version
83- * 2 of the License, or (at your option) any later version.
84- */
85-
86-#ifndef _LINUX_IF_ETHER_H
87-#define _LINUX_IF_ETHER_H
88-
89-#include <linux/types.h>
90-
91-/*
92- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
93- * and FCS/CRC (frame check sequence).
94- */
95-
96-#define ETH_ALEN 6 /* Octets in one ethernet addr */
97-#define ETH_HLEN 14 /* Total octets in header. */
98-#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
99-#define ETH_DATA_LEN 1500 /* Max. octets in payload */
100-#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
101-#define ETH_FCS_LEN 4 /* Octets in the FCS */
102-
103-/*
104- * These are the defined Ethernet Protocol ID's.
105- */
106-
107-#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
108-#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
109-#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
110-#define ETH_P_IP 0x0800 /* Internet Protocol packet */
111-#define ETH_P_X25 0x0805 /* CCITT X.25 */
112-#define ETH_P_ARP 0x0806 /* Address Resolution packet */
113-#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
114-#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
115-#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
116-#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
117-#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
118-#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
119-#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
120-#define ETH_P_LAT 0x6004 /* DEC LAT */
121-#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
122-#define ETH_P_CUST 0x6006 /* DEC Customer use */
123-#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
124-#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
125-#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
126-#define ETH_P_ATALK 0x809B /* Appletalk DDP */
127-#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
128-#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
129-#define ETH_P_IPX 0x8137 /* IPX over DIX */
130-#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
131-#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
132-#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
133-#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
134- * defined in draft-wilson-wrec-wccp-v2-00.txt */
135-#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
136-#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
137-#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
138-#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
139-#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
140-#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
141-#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
142- * over Ethernet
143- */
144-#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
145-#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
146-#define ETH_P_TIPC 0x88CA /* TIPC */
147-#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
148-#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
149-#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
150-#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
151-
152-/*
153- * Non DIX types. Won't clash for 1500 types.
154- */
155-
156-#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
157-#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
158-#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
159-#define ETH_P_802_2 0x0004 /* 802.2 frames */
160-#define ETH_P_SNAP 0x0005 /* Internal only */
161-#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
162-#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
163-#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
164-#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
165-#define ETH_P_CAN 0x000C /* Controller Area Network */
166-#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
167-#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
168-#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
169-#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
170-#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
171-#define ETH_P_ECONET 0x0018 /* Acorn Econet */
172-#define ETH_P_HDLC 0x0019 /* HDLC frames */
173-#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
174-#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
175-#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
176-#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
177-#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
178-#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
179-
180-/*
181- * This is an Ethernet frame header.
182- */
183-
184-struct ethhdr {
185- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
186- unsigned char h_source[ETH_ALEN]; /* source ether addr */
187- __be16 h_proto; /* packet type ID field */
188-} __attribute__((packed));
189-
190-
191-#endif /* _LINUX_IF_ETHER_H */
192diff --git a/useful_functions.c b/useful_functions.c
193index d14cbe9..c304f4d 100644
194--- a/useful_functions.c
195+++ b/useful_functions.c
196@@ -22,8 +22,6 @@
197 * along with this program; if not, write to the Free Software
198 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
199 */
200-#include "include/ebtables_u.h"
201-#include "include/ethernetdb.h"
202 #include <stdio.h>
203 #include <netinet/ether.h>
204 #include <string.h>
205@@ -33,6 +31,8 @@
206 #include <sys/types.h>
207 #include <sys/socket.h>
208 #include <arpa/inet.h>
209+#include "include/ebtables_u.h"
210+#include "include/ethernetdb.h"
211
212 const unsigned char mac_type_unicast[ETH_ALEN] = {0,0,0,0,0,0};
213 const unsigned char msk_type_unicast[ETH_ALEN] = {1,0,0,0,0,0};
214--
2152.12.1
216
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
index f5e28714e..375423d5d 100644
--- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
+++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -18,7 +18,17 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \
18 file://ebtables.common \ 18 file://ebtables.common \
19 file://ebtables.service \ 19 file://ebtables.service \
20 file://no-as-needed.patch \ 20 file://no-as-needed.patch \
21" 21 file://0001-add-RARP-and-update-iana-url.patch \
22 file://0002-fix-compilation-warning.patch \
23 file://0003-add-info-about-Wl-no-as-needed.patch \
24 file://0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch \
25 file://0005-Add-noflush-command-line-support-for-ebtables-restor.patch \
26 file://0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch \
27 file://0007-extensions-Use-stdint-types.patch \
28 file://0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch \
29 file://0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch \
30 file://0010-Adjust-header-include-sequence.patch \
31 "
22 32
23SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0" 33SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0"
24SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d" 34SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d"