net-firewall/rtsp-conntrack: fix compatibility with kernel 4.18
authorSergey Popov <pinkbyte@gentoo.org>
Mon, 27 Aug 2018 10:01:35 +0000 (13:01 +0300)
committerSergey Popov <pinkbyte@gentoo.org>
Mon, 27 Aug 2018 10:03:56 +0000 (13:03 +0300)
Port compatibility patch to make package work with wider kernel range.
Bump to EAPI 7.

Reported-by: Toralf Förster <toralf@gentoo.org>
Closes: https://bugs.gentoo.org/664368
Package-Manager: Portage-2.3.40, Repoman-2.3.9

net-firewall/rtsp-conntrack/files/rtsp-conntrack-3.7-linux-4.18.patch [new file with mode: 0644]
net-firewall/rtsp-conntrack/rtsp-conntrack-3.7.ebuild

diff --git a/net-firewall/rtsp-conntrack/files/rtsp-conntrack-3.7-linux-4.18.patch b/net-firewall/rtsp-conntrack/files/rtsp-conntrack-3.7-linux-4.18.patch
new file mode 100644 (file)
index 0000000..a10d994
--- /dev/null
@@ -0,0 +1,28 @@
+Port of 4.18 patch[1] to version 3.7 of rtsp-conntrack
+
+[1] - https://github.com/maru-sama/rtsp-linux/pull/7
+
+--- a/nf_nat_rtsp.c    2018-08-27 12:53:39.991467210 +0300
++++ b/nf_nat_rtsp.c    2018-08-27 12:53:56.087466258 +0300
+@@ -31,6 +31,7 @@
+  */
+ #include <linux/module.h>
++#include <linux/version.h>
+ #include <net/tcp.h>
+ #include <net/netfilter/nf_nat.h>
+ #include <net/netfilter/nf_nat_helper.h>
+@@ -430,7 +431,13 @@
+ static void expected(struct nf_conn* ct, struct nf_conntrack_expect *exp)
+ {
++    #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)
++    struct nf_nat_range2 range;
++    #elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+     struct nf_nat_range range;
++    #else
++    struct nf_nat_ipv4_range range;
++    #endif
+     union nf_inet_addr newdstip, newsrcip, newip;
+     struct nf_conn *master = ct->master;
index 51d0c0cf892b2f9f26010623457650ccb9e242a7..14fb40edd8231b21808959e01950625fb883a542 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit eutils linux-mod versionator
+EAPI=7
+inherit linux-mod
 
 DESCRIPTION="RTSP conntrack module for Netfilter"
 HOMEPAGE="http://mike.it-loops.com/rtsp"
@@ -14,6 +14,8 @@ KEYWORDS="amd64 x86"
 
 S="${WORKDIR}/rtsp"
 
+PATCHES=( "${FILESDIR}/${P}-linux-4.18.patch" )
+
 BUILD_TARGETS="all"
 MODULE_NAMES="
        nf_conntrack_rtsp(net/netfilter::)
@@ -24,12 +26,3 @@ CONFIG_CHECK="NF_CONNTRACK"
 WARNING_NF_CONNTRACK="You must enable NF_CONNTRACK in your kernel, otherwise ${PN} would not work"
 
 BUILD_PARAMS="KERNELDIR=${KERNEL_DIR} V=1"
-
-pkg_setup() {
-       linux-mod_pkg_setup
-       kernel_is -lt $(get_version_components) && die "This version of ${PN} would not work on kernels <= ${PV}"
-}
-
-src_prepare() {
-       epatch_user
-}