diff options
Diffstat (limited to 'meta/recipes-extended/iptables/iptables')
8 files changed, 103 insertions, 164 deletions
diff --git a/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch index ab609e27e3..03c36ccbc2 100644 --- a/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch +++ b/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch @@ -1,47 +1,47 @@ -From 5c47cf5061b852c02178f01e23690bfe38a99d93 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sun, 17 Mar 2013 11:21:35 -0700 +From c46db7c2e1f63ec525835553587e70c635565310 Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 21 Feb 2017 11:16:31 +0200 Subject: [PATCH] configure: Add option to enable/disable libnfnetlink This changes the configure behaviour from autodetecting for libnfnetlink to having an option to disable it explicitly -Signed-off-by: Khem Raj <raj.khem@gmail.com> - Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> --- - configure.ac | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) + configure.ac | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac -index ba616ab..ce2d315 100644 +index eda7871..03ddc50 100644 --- a/configure.ac +++ b/configure.ac -@@ -53,6 +53,9 @@ AC_ARG_ENABLE([libipq], - AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], - [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), - [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) +@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], + AC_ARG_ENABLE([nftables], + AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]), + [enable_nftables="$enableval"], [enable_nftables="yes"]) +AC_ARG_ENABLE([libnfnetlink], -+ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]), -+ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"]) - - libiptc_LDFLAGS2=""; - AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed], -@@ -89,9 +92,11 @@ AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"]) - AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"]) - AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"]) ++ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]), ++ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"]) + AC_ARG_ENABLE([connlabel], + AS_HELP_STRING([--disable-connlabel], + [Do not build libnetfilter_conntrack]), +@@ -115,9 +118,10 @@ if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then + AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool)) + fi -PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], - [nfnetlink=1], [nfnetlink=0]) -AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) +AS_IF([test "x$enable_libnfnetlink" = "xyes"], [ -+ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0]) -+ ]) -+ ++ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0]) ++ ]) +AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"]) - regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ - -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ + if test "x$enable_nftables" = "xyes"; then + PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0]) -- -1.7.9.5 +2.4.0 diff --git a/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch b/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch deleted file mode 100644 index 7a003d912f..0000000000 --- a/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 7c07b7fd4fdd7844dd032af822306f08e4422c34 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 6 Apr 2015 20:47:29 -0700 -Subject: [PATCH] fix build with musl - -Add needed headers they are just not needed for glibc6+ but also -for musl -Define additional TCOPTS if not there - -u_initX types are in sys/types.h be explicit about it - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - extensions/libxt_TCPOPTSTRIP.c | 15 +++++++++++++++ - include/libiptc/ipt_kernel_headers.h | 12 ------------ - include/linux/netfilter_ipv4/ip_tables.h | 1 + - 3 files changed, 16 insertions(+), 12 deletions(-) - -diff --git a/extensions/libxt_TCPOPTSTRIP.c b/extensions/libxt_TCPOPTSTRIP.c -index 6897857..8a170b2 100644 ---- a/extensions/libxt_TCPOPTSTRIP.c -+++ b/extensions/libxt_TCPOPTSTRIP.c -@@ -12,6 +12,21 @@ - #ifndef TCPOPT_MD5SIG - # define TCPOPT_MD5SIG 19 - #endif -+#ifndef TCPOPT_MAXSEG -+# define TCPOPT_MAXSEG 2 -+#endif -+#ifndef TCPOPT_WINDOW -+# define TCPOPT_WINDOW 3 -+#endif -+#ifndef TCPOPT_SACK_PERMITTED -+# define TCPOPT_SACK_PERMITTED 4 -+#endif -+#ifndef TCPOPT_SACK -+# define TCPOPT_SACK 5 -+#endif -+#ifndef TCPOPT_TIMESTAMP -+# define TCPOPT_TIMESTAMP 8 -+#endif - - enum { - O_STRIP_OPTION = 0, -diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h -index 18861fe..a5963e9 100644 ---- a/include/libiptc/ipt_kernel_headers.h -+++ b/include/libiptc/ipt_kernel_headers.h -@@ -5,7 +5,6 @@ - - #include <limits.h> - --#if defined(__GLIBC__) && __GLIBC__ == 2 - #include <netinet/ip.h> - #include <netinet/in.h> - #include <netinet/ip_icmp.h> -@@ -13,15 +12,4 @@ - #include <netinet/udp.h> - #include <net/if.h> - #include <sys/types.h> --#else /* libc5 */ --#include <sys/socket.h> --#include <linux/ip.h> --#include <linux/in.h> --#include <linux/if.h> --#include <linux/icmp.h> --#include <linux/tcp.h> --#include <linux/udp.h> --#include <linux/types.h> --#include <linux/in6.h> --#endif - #endif -diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h -index 57fd82a..4807246 100644 ---- a/include/linux/netfilter_ipv4/ip_tables.h -+++ b/include/linux/netfilter_ipv4/ip_tables.h -@@ -15,6 +15,7 @@ - #ifndef _IPTABLES_H - #define _IPTABLES_H - -+#include <sys/types.h> - #include <linux/types.h> - - #include <linux/netfilter_ipv4.h> --- -2.1.4 - diff --git a/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch new file mode 100644 index 0000000000..7842c6408a --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch @@ -0,0 +1,51 @@ +From 26090b3dbcdf6a11e60535da949b726a6e86426d Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <maxin.john@intel.com> +Date: Tue, 21 Feb 2017 11:49:07 +0200 +Subject: [PATCH] configure.ac: + only-check-conntrack-when-libnfnetlink-enabled.patch + +Package libnetfilter-conntrack depends on package libnfnetlink. iptables +checks package libnetfilter-conntrack whatever its package config +libnfnetlink is enabled or not. When libnfnetlink is disabled but +package libnetfilter-conntrack exists, it fails randomly with: + +In file included from +.../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0: + +.../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42: +fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory + +compilation terminated. +GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed +Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it. + +Upstream-Status: Pending + +Signed-off-by: Kai Kang <kai.kang@windriver.com> +Signed-off-by: Maxin B. John <maxin.john@intel.com> +--- + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 03ddc50..523caea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -172,10 +172,12 @@ if test "$nftables" != 1; then + fi + + if test "x$enable_connlabel" = "xyes"; then +- PKG_CHECK_MODULES([libnetfilter_conntrack], ++ nfconntrack=0 ++ AS_IF([test "x$enable_libnfnetlink" = "xyes"], [ ++ PKG_CHECK_MODULES([libnetfilter_conntrack], + [libnetfilter_conntrack >= 1.0.6], + [nfconntrack=1], [nfconntrack=0]) +- ++ ]) + if test "$nfconntrack" -ne 1; then + blacklist_modules="$blacklist_modules connlabel"; + echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built"; +-- +2.4.0 + diff --git a/meta/recipes-extended/iptables/iptables/ip6tables.rules b/meta/recipes-extended/iptables/iptables/ip6tables.rules new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/ip6tables.rules diff --git a/meta/recipes-extended/iptables/iptables/ip6tables.service b/meta/recipes-extended/iptables/iptables/ip6tables.service new file mode 100644 index 0000000000..6c059fca49 --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/ip6tables.service @@ -0,0 +1,13 @@ +[Unit] +Description=IPv6 Packet Filtering Framework +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +ExecStart=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules +ExecReload=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-extended/iptables/iptables/iptables.rules b/meta/recipes-extended/iptables/iptables/iptables.rules new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/iptables.rules diff --git a/meta/recipes-extended/iptables/iptables/iptables.service b/meta/recipes-extended/iptables/iptables/iptables.service new file mode 100644 index 0000000000..0eb3c343de --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/iptables.service @@ -0,0 +1,13 @@ +[Unit] +Description=IPv4 Packet Filtering Framework +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +ExecStart=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules +ExecReload=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch b/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch deleted file mode 100644 index 24ee29e2d1..0000000000 --- a/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 19593491f43b70c1a71c3b9b8f4ff4fd14500014 Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@windriver.com> -Date: Fri, 23 Mar 2012 14:27:20 -0400 -Subject: [PATCH] types.h: add defines that are required for if_packet.h - -The iptables local linux/types.h overrides the kernel/sysroot -types.h. As such, we need to provide some defines that are required -to build against 3.2+ kernel headers. - -ifndef protection is provided for the defines to ensure that -configuration that already have these defines are still buildable. - -This commit is temporary until a new version of iptables can be -used that contains the defines. - -This is similar to the commit in the iptables git repository: - - https://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=dbe77cc974cee656eae37e75039dd1a410a4535b - -Upstream-Status: Backport - -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - include/linux/types.h | 10 ++++++++++ - 1 files changed, 10 insertions(+), 0 deletions(-) - -diff --git a/include/linux/types.h b/include/linux/types.h -index 8b483c8..ebf6432 100644 ---- a/include/linux/types.h -+++ b/include/linux/types.h -@@ -34,5 +34,15 @@ typedef __u64 __bitwise __be64; - typedef __u16 __bitwise __sum16; - typedef __u32 __bitwise __wsum; - -+#ifndef __aligned_u64 -+#define __aligned_u64 __u64 __attribute__((aligned(8))) -+#endif -+#ifndef __aligned_be64 -+#define __aligned_be64 __be64 __attribute__((aligned(8))) -+#endif -+#ifndef __aligned_le64 -+#define __aligned_le64 __le64 __attribute__((aligned(8))) -+#endif -+ - #endif /* __ASSEMBLY__ */ - #endif /* _LINUX_TYPES_H */ --- -1.7.0.4 - |