From e42433d7127f9a50b5dae57fff331ecfdc9883c4 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 27 Apr 2010 20:58:44 +0200 Subject: iptv via natting now works at last sometime. alice iptv seems to use destination=ip:port instead of client_port=port, like RFC suggesting it. But destination= is also used by STUN method. As a quick hack I commented out STUN method to avoid crashes. Now at least I can see some tv streams. still not 100% good. --- package/rtsp/src/nf_conntrack_rtsp.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'package/rtsp/src/nf_conntrack_rtsp.c') diff --git a/package/rtsp/src/nf_conntrack_rtsp.c b/package/rtsp/src/nf_conntrack_rtsp.c index c1002aca9..7b5d2be67 100644 --- a/package/rtsp/src/nf_conntrack_rtsp.c +++ b/package/rtsp/src/nf_conntrack_rtsp.c @@ -177,14 +177,15 @@ rtsp_parse_transport(char* ptran, uint tranlen, pr_info("sanity check failed\n"); return 0; } - - pr_debug("tran='%.*s'\n", (int)tranlen, ptran); + + pr_debug("t='%.*s'\n", (int)tranlen-2, ptran); off += 10; SKIP_WSPACE(ptran, tranlen, off); /* Transport: tran;field;field=val,tran;field;field=val,... */ while (off < tranlen) { const char* pparamend; + const char* pdestport; uint nextparamoff; pparamend = memchr(ptran+off, ',', tranlen-off); @@ -236,6 +237,31 @@ rtsp_parse_transport(char* ptran, uint tranlen, rc = 1; } } + else if ((strncmp(ptran+off, "destination=",12) == 0) && + ((pdestport = memchr(ptran+off, ':', nextparamoff-off)) != NULL)) + { + u_int16_t port; + uint numlen; + + off += 12; + pdestport++; + + off = pdestport - ptran; + numlen = nf_strtou16(ptran + off, &port); + off += numlen + 1; + + if (prtspexp->loport != 0 && prtspexp->loport != port) + { + pr_debug("multiple ports found, port %hu ignored\n", port); + } + else + { + prtspexp->pbtype = pb_single; + prtspexp->loport = port; + prtspexp->hiport = port; + rc = 1; + } + } /* * Note we don't look for the destination parameter here. -- cgit v1.2.3