diff options
author | Rosen Penev <rosenp@gmail.com> | 2020-07-04 11:39:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 11:39:17 -0700 |
commit | 390c06a738cf0a2a624da16c4b47aeefcd070d77 (patch) | |
tree | c151d6835d80bb44c4fa7799326e19bfe497a930 | |
parent | 35734b81cd94808dead33a3a7a61332f52ec2691 (diff) | |
parent | 901a33667b2841b14964d6bce31b561a937bafb5 (diff) |
Merge pull request #12338 from alinnastac/rtsp-pb_discon
xtables-addons: fix RTSP helper support for client_port=x/y Transport…
-rw-r--r-- | net/xtables-addons/patches/100-add-rtsp-conntrack.patch | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch index 9eddf780d..dbdc52e94 100644 --- a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch +++ b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch @@ -671,7 +671,7 @@ + + 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); @@ -833,7 +833,7 @@ + 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 */ @@ -1082,7 +1082,7 @@ +#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> @@ -1333,8 +1333,8 @@ + } + } + 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; + } @@ -1343,6 +1343,11 @@ + 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; + } |