summaryrefslogtreecommitdiff
path: root/package/rtsp/src/nf_conntrack_rtsp.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-04-27 20:58:44 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-04-27 20:58:44 +0200
commite42433d7127f9a50b5dae57fff331ecfdc9883c4 (patch)
tree81cc6860ef65e4077ce59a190d3bbf7166400959 /package/rtsp/src/nf_conntrack_rtsp.c
parent4b2636bd2aea3aa4f5844083a1de0e9283f31a7a (diff)
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.
Diffstat (limited to 'package/rtsp/src/nf_conntrack_rtsp.c')
-rw-r--r--package/rtsp/src/nf_conntrack_rtsp.c30
1 files changed, 28 insertions, 2 deletions
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.