Gentoo Archives: gentoo-commits

From: Sergey Popov <pinkbyte@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/rtsp-conntrack/files/, net-firewall/rtsp-conntrack/
Date: Wed, 02 Oct 2019 14:33:58
Message-Id: 1570026827.cd00367401c11d4d9948453b952912cb6b7e2661.pinkbyte@gentoo
1 commit: cd00367401c11d4d9948453b952912cb6b7e2661
2 Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 2 14:33:23 2019 +0000
4 Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 2 14:33:47 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd003674
7
8 net-firewall/rtsp-conntrack: version bump
9
10 Add compatibility patch for kernel 5.3
11
12 Reported-by: Toralf Förster <toralf <AT> gentoo.org>
13 Closes: https://bugs.gentoo.org/695476
14 Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
15 Package-Manager: Portage-2.3.66, Repoman-2.3.11
16
17 net-firewall/rtsp-conntrack/Manifest | 1 +
18 .../files/rtsp-conntrack-4.18-linux-5.3.patch | 122 +++++++++++++++++++++
19 .../rtsp-conntrack/rtsp-conntrack-4.18.ebuild | 28 +++++
20 3 files changed, 151 insertions(+)
21
22 diff --git a/net-firewall/rtsp-conntrack/Manifest b/net-firewall/rtsp-conntrack/Manifest
23 index bc425840e00..4754b9c68cb 100644
24 --- a/net-firewall/rtsp-conntrack/Manifest
25 +++ b/net-firewall/rtsp-conntrack/Manifest
26 @@ -1 +1,2 @@
27 +DIST rtsp-conntrack-4.18.tar.gz 12369 BLAKE2B ef5b3947ba563f3bc507e6ab1764a68ae14bdee228c37608fe4e0f0a0be5356b4cdcbcdeb7f47f7a0a36d64b77de8124f3ec4b0a14fa67747c88c3e4be9042f5 SHA512 c8f176153f2a1bc32702d309247641b80ff98d0b1b5cc4d2e05bf4e7a04be00ea4c2e0afef0fa398768f61a84c984528ddabae730931d3156f174b097c8566db
28 DIST rtsp-module-3.7.tar.gz 11474 BLAKE2B feb6f925c779ada01ef305ee91e4c805816bc3a62316ec4e89d8599f5e995f2d07a0de8ad76763eb9de9b4a24c065bd63b50e2f1eb2ef9959495baf2e3794920 SHA512 480316f41f7e9a2a75b73b3edcbbdc98bf293f013a5549c6829659e601d2d1ec0ac94f7a2519cd6e40d41cbd02cf64f81fe2a371c703c3b0ba36d200fe29a3c1
29
30 diff --git a/net-firewall/rtsp-conntrack/files/rtsp-conntrack-4.18-linux-5.3.patch b/net-firewall/rtsp-conntrack/files/rtsp-conntrack-4.18-linux-5.3.patch
31 new file mode 100644
32 index 00000000000..66a35019817
33 --- /dev/null
34 +++ b/net-firewall/rtsp-conntrack/files/rtsp-conntrack-4.18-linux-5.3.patch
35 @@ -0,0 +1,122 @@
36 +From 57394bcd68459d3c31cc605e538824a41ba490d9 Mon Sep 17 00:00:00 2001
37 +From: Seth Forshee <seth.forshee@×××××××××.com>
38 +Date: Fri, 30 Aug 2019 09:10:23 -0500
39 +Subject: [PATCH] Fix build with Linux 5.3
40 +
41 +In Linux 5.3 nf_ct_expect_related() gained a flags argument.
42 +Calls to this function are sprinkled throughout a couple of
43 +source files, so rather than adding a #if to each call site, add
44 +a wrapper which will use the appropriate prototype.
45 +
46 +Signed-off-by: Seth Forshee <seth.forshee@×××××××××.com>
47 +---
48 + netfilter_helpers.h | 11 +++++++++++
49 + nf_conntrack_rtsp.c | 5 ++---
50 + nf_nat_rtsp.c | 11 +++++------
51 + 3 files changed, 18 insertions(+), 9 deletions(-)
52 +
53 +diff --git a/netfilter_helpers.h b/netfilter_helpers.h
54 +index 903f374..d8b8ce3 100644
55 +--- a/netfilter_helpers.h
56 ++++ b/netfilter_helpers.h
57 +@@ -14,6 +14,8 @@
58 + /* Only include these functions for kernel code. */
59 + #ifdef __KERNEL__
60 +
61 ++#include <net/netfilter/nf_conntrack_expect.h>
62 ++
63 + #include <linux/ctype.h>
64 + #define iseol(c) ( (c) == '\r' || (c) == '\n' )
65 +
66 +@@ -128,6 +130,15 @@ nf_nextline(char* p, uint len, uint* poff, uint* plineoff, uint* plinelen)
67 + }
68 + #endif /* NF_NEED_NEXTLINE */
69 +
70 ++static inline int rtsp_nf_ct_expect_related(struct nf_conntrack_expect *expect)
71 ++{
72 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
73 ++ return nf_ct_expect_related(expect, 0);
74 ++#else
75 ++ return nf_ct_expect_related(expect);
76 ++#endif
77 ++}
78 ++
79 + #endif /* __KERNEL__ */
80 +
81 + #endif /* _NETFILTER_HELPERS_H */
82 +diff --git a/nf_conntrack_rtsp.c b/nf_conntrack_rtsp.c
83 +index 8a2f182..300be0a 100644
84 +--- a/nf_conntrack_rtsp.c
85 ++++ b/nf_conntrack_rtsp.c
86 +@@ -41,7 +41,6 @@
87 + #include <net/tcp.h>
88 +
89 + #include <net/netfilter/nf_conntrack.h>
90 +-#include <net/netfilter/nf_conntrack_expect.h>
91 + #include <net/netfilter/nf_conntrack_helper.h>
92 + #include "nf_conntrack_rtsp.h"
93 +
94 +@@ -396,8 +395,8 @@ help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen,
95 + &expinfo, rtp_exp, rtcp_exp);
96 + #endif
97 + else {
98 +- if (nf_ct_expect_related(rtp_exp) == 0) {
99 +- if (rtcp_exp && nf_ct_expect_related(rtcp_exp) != 0) {
100 ++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
101 ++ if (rtcp_exp && rtsp_nf_ct_expect_related(rtcp_exp) != 0) {
102 + nf_ct_unexpect_related(rtp_exp);
103 + pr_info("nf_conntrack_expect_related failed for rtcp\n");
104 + ret = NF_DROP;
105 +diff --git a/nf_nat_rtsp.c b/nf_nat_rtsp.c
106 +index 59ea4fd..02b46c5 100644
107 +--- a/nf_nat_rtsp.c
108 ++++ b/nf_nat_rtsp.c
109 +@@ -46,7 +46,6 @@
110 + #endif
111 + #include <net/netfilter/nf_nat_helper.h>
112 + #include "nf_conntrack_rtsp.h"
113 +-#include <net/netfilter/nf_conntrack_expect.h>
114 +
115 + #include <linux/inet.h>
116 + #include <linux/ctype.h>
117 +@@ -202,7 +201,7 @@ rtsp_mangle_tran(enum ip_conntrack_info ctinfo,
118 + case pb_single:
119 + for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
120 + rtp_t->dst.u.udp.port = htons(loport);
121 +- if (nf_ct_expect_related(rtp_exp) == 0) {
122 ++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
123 + pr_debug("using port %hu\n", loport);
124 + break;
125 + }
126 +@@ -215,12 +214,12 @@ rtsp_mangle_tran(enum ip_conntrack_info ctinfo,
127 + case pb_range:
128 + for (loport = prtspexp->loport; loport != 0; loport += 2) { /* XXX: improper wrap? */
129 + rtp_t->dst.u.udp.port = htons(loport);
130 +- if (nf_ct_expect_related(rtp_exp) != 0) {
131 ++ if (rtsp_nf_ct_expect_related(rtp_exp) != 0) {
132 + continue;
133 + }
134 + hiport = loport + 1;
135 + rtcp_exp->tuple.dst.u.udp.port = htons(hiport);
136 +- if (nf_ct_expect_related(rtcp_exp) != 0) {
137 ++ if (rtsp_nf_ct_expect_related(rtcp_exp) != 0) {
138 + nf_ct_unexpect_related(rtp_exp);
139 + continue;
140 + }
141 +@@ -243,14 +242,14 @@ rtsp_mangle_tran(enum ip_conntrack_info ctinfo,
142 + case pb_discon:
143 + for (loport = prtspexp->loport; loport != 0; loport++) { /* XXX: improper wrap? */
144 + rtp_t->dst.u.udp.port = htons(loport);
145 +- if (nf_ct_expect_related(rtp_exp) == 0) {
146 ++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
147 + pr_debug("using port %hu (1 of 2)\n", loport);
148 + break;
149 + }
150 + }
151 + for (hiport = prtspexp->hiport; hiport != 0; hiport++) { /* XXX: improper wrap? */
152 + rtp_t->dst.u.udp.port = htons(hiport);
153 +- if (nf_ct_expect_related(rtp_exp) == 0) {
154 ++ if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
155 + pr_debug("using port %hu (2 of 2)\n", hiport);
156 + break;
157 + }
158
159 diff --git a/net-firewall/rtsp-conntrack/rtsp-conntrack-4.18.ebuild b/net-firewall/rtsp-conntrack/rtsp-conntrack-4.18.ebuild
160 new file mode 100644
161 index 00000000000..e163cee5f15
162 --- /dev/null
163 +++ b/net-firewall/rtsp-conntrack/rtsp-conntrack-4.18.ebuild
164 @@ -0,0 +1,28 @@
165 +# Copyright 1999-2019 Gentoo Authors
166 +# Distributed under the terms of the GNU General Public License v2
167 +
168 +EAPI=7
169 +inherit linux-mod
170 +
171 +DESCRIPTION="RTSP conntrack module for Netfilter"
172 +HOMEPAGE="http://mike.it-loops.com/rtsp"
173 +SRC_URI="https://github.com/maru-sama/rtsp-linux/archive/${PV}.tar.gz -> ${P}.tar.gz"
174 +
175 +LICENSE="GPL-2"
176 +SLOT="0"
177 +KEYWORDS="~amd64 ~x86"
178 +
179 +S="${WORKDIR}/rtsp-linux-${PV}"
180 +
181 +PATCHES=( "${FILESDIR}/${P}-linux-5.3.patch" )
182 +
183 +BUILD_TARGETS="all"
184 +MODULE_NAMES="
185 + nf_conntrack_rtsp(net/netfilter::)
186 + nf_nat_rtsp(net/ipv4/netfilter::)"
187 +MODULESD_NF_CONNTRACK_RTSP_DOCS="README.rst"
188 +
189 +CONFIG_CHECK="NF_CONNTRACK"
190 +WARNING_NF_CONNTRACK="You must enable NF_CONNTRACK in your kernel, otherwise ${PN} would not work"
191 +
192 +BUILD_PARAMS="KERNELDIR=${KERNEL_DIR} V=1"