summaryrefslogtreecommitdiff
path: root/package/rtsp/src/nf_conntrack_rtsp.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2013-07-16 18:31:40 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2013-07-16 18:31:40 +0200
commit67b446e46200c81339dde33e3501d17807e7e7ee (patch)
treee42da39cb778218e057c9afd65fef9ae8bdfcf30 /package/rtsp/src/nf_conntrack_rtsp.c
parent4a798d171d2b1d06bf85de54d51c817866af9a9b (diff)
disable for arm
Diffstat (limited to 'package/rtsp/src/nf_conntrack_rtsp.c')
-rw-r--r--package/rtsp/src/nf_conntrack_rtsp.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/package/rtsp/src/nf_conntrack_rtsp.c b/package/rtsp/src/nf_conntrack_rtsp.c
index 75aada89b..f165ea0c9 100644
--- a/package/rtsp/src/nf_conntrack_rtsp.c
+++ b/package/rtsp/src/nf_conntrack_rtsp.c
@@ -73,6 +73,7 @@ static struct nf_conntrack_expect_policy rtsp_exp_policy;
unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
+ unsigned int protoff,
unsigned int matchoff, unsigned int matchlen,struct ip_ct_rtsp_expect* prtspexp,
struct nf_conntrack_expect *exp);
void (*nf_nat_rtsp_hook_expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
@@ -177,15 +178,14 @@ rtsp_parse_transport(char* ptran, uint tranlen,
pr_info("sanity check failed\n");
return 0;
}
-
- pr_debug("t='%.*s'\n", (int)tranlen-2, ptran);
+
+ pr_debug("tran='%.*s'\n", (int)tranlen, 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);
@@ -237,31 +237,6 @@ 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.
@@ -294,7 +269,8 @@ void expected(struct nf_conn *ct, struct nf_conntrack_expect *exp)
static inline int
help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen,
- struct nf_conn *ct, enum ip_conntrack_info ctinfo)
+ struct nf_conn *ct, enum ip_conntrack_info ctinfo,
+ unsigned int protoff)
{
struct ip_ct_rtsp_expect expinfo;
@@ -370,15 +346,15 @@ help_out(struct sk_buff *skb, unsigned char *rb_ptr, unsigned int datalen,
}
pr_debug("expect_related %pI4:%u-%pI4:%u\n",
- exp->tuple.src.u3.ip,
+ &exp->tuple.src.u3.ip,
ntohs(exp->tuple.src.u.udp.port),
- exp->tuple.dst.u3.ip,
+ &exp->tuple.dst.u3.ip,
ntohs(exp->tuple.dst.u.udp.port));
nf_nat_rtsp = rcu_dereference(nf_nat_rtsp_hook);
if (nf_nat_rtsp && ct->status & IPS_NAT_MASK)
/* pass the request off to the nat helper */
- ret = nf_nat_rtsp(skb, ctinfo, hdrsoff, hdrslen, &expinfo, exp);
+ ret = nf_nat_rtsp(skb, ctinfo, protoff, hdrsoff, hdrslen, &expinfo, exp);
else if (nf_ct_expect_related(exp) != 0) {
pr_info("nf_conntrack_expect_related failed\n");
ret = NF_DROP;
@@ -445,7 +421,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,
switch (CTINFO2DIR(ctinfo)) {
case IP_CT_DIR_ORIGINAL:
- ret = help_out(skb, rb_ptr, datalen, ct, ctinfo);
+ ret = help_out(skb, rb_ptr, datalen, ct, ctinfo, protoff);
break;
case IP_CT_DIR_REPLY:
pr_debug("IP_CT_DIR_REPLY\n");
@@ -522,7 +498,7 @@ init(void)
} else {
sprintf(tmpname, "rtsp-%d", i);
}
- hlpr->name = tmpname;
+ strlcpy(hlpr->name, tmpname, sizeof(hlpr->name));
pr_debug("port #%d: %d\n", i, ports[i]);