From a0bd2ac5ca14b0b670df2b0934fea96b1b89a1fc Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Tue, 28 Jan 2020 12:21:28 +0300 Subject: net-firewall/ipt_netflow-2.4: build-time fixes Fix building with kernel where CONFIG_BRIDGE_NETFILTER is not set Signed-off-by: Sergey Popov Package-Manager: Portage-2.3.84, Repoman-2.3.11 --- .../files/ipt_netflow-2.4-bridge_netfilter.patch | 61 ++++++++++++++++++++++ net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild | 3 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch b/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch new file mode 100644 index 000000000000..cde23bc9fe7c --- /dev/null +++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch @@ -0,0 +1,61 @@ +From 9288e30f493d252ee85b492a894f78073e4f6d41 Mon Sep 17 00:00:00 2001 +From: ABC +Date: Sat, 28 Sep 2019 23:29:40 +0300 +Subject: [PATCH] Don't compile physdev-override if BRIDGE_NETFILTER is + disabled. + +Fixes #120 "Compile error nf_bridge / nf_trace" reported by DocMAX. + +Fixes: 51bdc2b ("Use nf_bridge_info_get() instead of skb->nf_bridge"). +--- + compat.h | 2 ++ + configure | 1 + + ipt_NETFLOW.c | 5 +++++ + 3 files changed, 8 insertions(+) + +diff --git a/compat.h b/compat.h +index 0f9896b..66e224b 100644 +--- a/compat.h ++++ b/compat.h +@@ -680,11 +680,13 @@ static inline int is_vlan_dev(struct net_device *dev) + #endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) ++# ifdef CONFIG_BRIDGE_NETFILTER + static inline struct nf_bridge_info * + nf_bridge_info_get(const struct sk_buff *skb) + { + return skb->nf_bridge; + } ++# endif + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) +diff --git a/configure b/configure +index 74eece5..8aae8bf 100755 +--- a/configure ++++ b/configure +@@ -470,6 +470,7 @@ kernel_check_config() { + kconfig CONFIG_NF_CONNTRACK_EVENTS "natevents" + kconfig CONFIG_IPV6 "IPv6" + kconfig CONFIG_IP6_NF_IPTABLES "ip6tables target" ++ kconfig CONFIG_BRIDGE_NETFILTER "physdev override" + } + + kernel_check_include() { +diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c +index fe25655..064de6c 100644 +--- a/ipt_NETFLOW.c ++++ b/ipt_NETFLOW.c +@@ -83,6 +83,11 @@ + #if defined(CONFIG_NF_NAT_NEEDED) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) + # include + #endif ++#ifdef ENABLE_PHYSDEV_OVER ++# ifndef CONFIG_BRIDGE_NETFILTER ++# undef ENABLE_PHYSDEV_OVER ++# endif ++#endif + + #define IPT_NETFLOW_VERSION "2.4" /* Note that if you are using git, you + will see version in other format. */ diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild index 8db277d79e5a..c3bec366b466 100644 --- a/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild +++ b/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -28,6 +28,7 @@ DEPEND="${RDEPEND} PATCHES=( "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984 "${FILESDIR}/${PN}-2.3-flags.patch" + "${FILESDIR}/${P}-bridge_netfilter.patch" ) pkg_setup() { -- cgit v1.2.3-65-gdbad