xtables-addons: fix RTSP helper support for client_port=x/y Transport attribute
authorAlin Nastac <redacted>
Wed, 27 May 2020 07:34:25 +0000 (09:34 +0200)
committerAlin Nastac <redacted>
Wed, 27 May 2020 10:49:21 +0000 (12:49 +0200)
Signed-off-by: Alin Nastac <redacted>
net/xtables-addons/Makefile
net/xtables-addons/patches/100-add-rtsp-conntrack.patch

index dff450a6b8ea557fdbb984355c6c7d6adf9bb030..8b7aea502da61a0edef4a2c2fe3f8b9cacc74432 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
 PKG_VERSION:=3.9
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_HASH:=064dd68937d98e6cfcbdf51ef459310d9810c17ab31b21285bc7a76cdcef7c49
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
index 9eddf780d49af53a3bb314e5932652ce72d15af8..dbdc52e94638208c1ad7eec85abe0a885dbf031a 100644 (file)
 +
 +              rtp_exp->flags = 0;
 +
-+              if (expinfo.pbtype == pb_range) {
++              if (expinfo.pbtype == pb_range || expinfo.pbtype == pb_discon) {
 +                      pr_debug("setup expectation for rtcp\n");
 +
 +                      be_hiport = htons(expinfo.hiport);
 +                      goto out;
 +
 +              /* replace rtcp expect src addr */
-+              if (expinfo.pbtype == pb_range) {
++              if (expinfo.pbtype == pb_range || expinfo.pbtype == pb_discon) {
 +                      t.dst.u.all = htons(expinfo.hiport);
 +
 +                      /* get the rtcp expect and replace the srcaddr with RTP server addr */
 +#endif /* _IP_CONNTRACK_RTSP_H */
 --- /dev/null
 +++ b/extensions/rtsp/nf_nat_rtsp.c
-@@ -0,0 +1,635 @@
+@@ -0,0 +1,640 @@
 +/*
 + * RTSP extension for TCP NAT alteration
 + * (C) 2003 by Tom Marshall <tmarshall at real.com>
 +                      }
 +              }
 +              for (hiport = prtspexp->hiport; hiport != 0; hiport++) { /* XXX: improper wrap? */
-+                      rtp_t->dst.u.udp.port = htons(hiport);
-+                      if (rtsp_nf_ct_expect_related(rtp_exp) == 0) {
++                      rtcp_exp->tuple.dst.u.udp.port = htons(hiport);
++                      if (rtsp_nf_ct_expect_related(rtcp_exp) == 0) {
 +                              pr_debug("using port %hu (2 of 2)\n", hiport);
 +                              break;
 +                      }
 +                      rbuf1len = sprintf(rbuf1, "%hu", loport);
 +                      rbufalen = sprintf(rbufa, hiport == loport+1 ?
 +                                         "%hu-%hu":"%hu/%hu", loport, hiport);
++              } else {
++                      if (loport != 0)
++                              nf_ct_unexpect_related(rtp_exp);
++                      if (hiport != 0)
++                              nf_ct_unexpect_related(rtcp_exp);
 +              }
 +              break;
 +      }
git clone https://git.99rst.org/PROJECT