Skip to contentSkip to conversation

iptables: fix build with musl

PATCH New Baruch Siach 2 participants 4 messages Mar 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables: fix build with musl

Add a patch that defines _GNU_SOURCE to expose some struct tcphdr fields.

Fixes:
http://autobuild.buildroot.net/results/bee/bee20b689345b593378cfd91e0abc48bf381d3f9/

---
 ...utils-nfsynproxy-fix-build-with-musl-libc.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/iptables/0001-utils-nfsynproxy-fix-build-with-musl-libc.patch
package/iptables/0001-utils-nfsynproxy-fix-build-with-musl-libc.patch new file +44 -0
new file mode 100644
index 000000000000..1f86ad135490
@@ -0,0 +1,44 @@
+From 06e0312d0bfd1f0b9e7c23ab654f18524d49e86b Mon Sep 17 00:00:00 2001
+From: Baruch Siach <[email protected]>
+Date: Thu, 2 Mar 2017 09:20:48 +0200
+Subject: [PATCH] utils: nfsynproxy: fix build with musl libc
+
+The musl libc exposes some struct tcphdr field only when _GNU_SOURCE is
+defined. Fix the following build failure:
+
+nfsynproxy.c: In function ?parse_packet?:
+nfsynproxy.c:34:9: error: ?const struct tcphdr? has no member named ?syn?
+  if (!th->syn || !th->ack)
+         ^
+nfsynproxy.c:34:21: error: ?const struct tcphdr? has no member named ?ack?
+  if (!th->syn || !th->ack)
+                     ^
+nfsynproxy.c:42:8: error: ?const struct tcphdr? has no member named ?res2?
+  if (th->res2 == 0x1)
+        ^
+nfsynproxy.c:45:13: error: ?const struct tcphdr? has no member named ?doff?
+  length = th->doff * 4 - sizeof(*th);
+             ^
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+Upstream status: pending (http://patchwork.ozlabs.org/patch/734503/)
+
+ utils/nfsynproxy.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/nfsynproxy.c b/utils/nfsynproxy.c
+index baedc92c5d9f..bf5c416340f1 100644
+--- a/utils/nfsynproxy.c
++++ b/utils/nfsynproxy.c
+@@ -6,6 +6,7 @@
+  * published by the Free Software Foundation.
+  */
+ 
++#define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <stdbool.h>
+ #include <unistd.h>
+-- 
+2.11.0
+
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 iptables: fix build with musl

Hello,

Quoted 10 lines · Baruch Siach

Add a patch that defines _GNU_SOURCE to expose some struct tcphdr fields.

Fixes:
http://autobuild.buildroot.net/results/bee/bee20b689345b593378cfd91e0abc48bf381d3f9/

---
 ...utils-nfsynproxy-fix-build-with-musl-libc.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/iptables/0001-utils-nfsynproxy-fix-build-with-musl-libc.patch

Applied to master, thanks. Peter: I believe this one is *not* needed for the LTS branch, because it fixes a problem with the iptables 1.6.1 bump, which was merged after the 2017.02 release. Baruch, could you confirm?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 iptables: fix build with musl

Hi Thomas,

Quoted 12 lines · Thomas Petazzoni
Quoted 10 lines · Baruch Siach

Add a patch that defines _GNU_SOURCE to expose some struct tcphdr fields.

Fixes:
http://autobuild.buildroot.net/results/bee/bee20b689345b593378cfd91e0abc48bf381d3f9/

---
 ...utils-nfsynproxy-fix-build-with-musl-libc.patch | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/iptables/0001-utils-nfsynproxy-fix-build-with-musl-libc.patch
Quoted 4 lines

Applied to master, thanks. Peter: I believe this one is *not* needed for the LTS branch, because it fixes a problem with the iptables 1.6.1 bump, which was merged after the 2017.02 release. Baruch, could you confirm?

It's true that this issue does not effect 2017.02, but not because of the iptables version. In 2017.02 iptables is disabled for musl build. Commit 6a27508ffb (Revert "package/iptables: nfsynproxy not available on musl") that enabled musl was applied to next.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/1 iptables: fix build with musl

Hello,

Quoted 9 lines · Baruch Siach
Quoted 4 lines

Applied to master, thanks. Peter: I believe this one is *not* needed for the LTS branch, because it fixes a problem with the iptables 1.6.1 bump, which was merged after the 2017.02 release. Baruch, could you confirm?

It's true that this issue does not effect 2017.02, but not because of the iptables version. In 2017.02 iptables is disabled for musl build. Commit 6a27508ffb (Revert "package/iptables: nfsynproxy not available on musl") that enabled musl was applied to next.

OK. Thanks for the explanation!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com