switch (prtspexp->pbtype)
{
case pb_single:
- for (loport = prtspexp->loport; loport != 0; loport++) /* XXX: improper wrap? */
- {
- DEBUGP("Original UDP PORT value is %hu exp loport %hu hiport %hu\n", t.dst.u.udp.port,
- prtspexp->loport, prtspexp->hiport);
- // Do not transpose the ports yet. If you do, you better register a helper
- // to mangle them correctly when you receive packets on those ports.
- //t.dst.u.udp.port = htons(loport);
- if (ip_conntrack_change_expect(exp, &t) == 0)
- {
- DEBUGP("using port %hu\n", loport);
- break;
- }
- }
+ loport = prtspexp->loport;
+ DEBUGP("PB_SINGLE: LO_PORT %hu\n", loport);
if (loport != 0)
{
rbuf1len = sprintf(rbuf1, "%hu", loport);
break;
case pb_range:
loport = prtspexp->loport;
+ DEBUGP("PB_RANGE: LO_PORT %hu\n", loport);
if (loport != 0)
{
rbuf1len = sprintf(rbuf1, "%hu", loport);
}
break;
case pb_discon:
+ DEBUGP("PB_DISCON:n");
for (loport = prtspexp->loport; loport != 0; loport++) /* XXX: improper wrap? */
{
DEBUGP("Original UDP PORT value is %hu exp loport %hu hiport %hu\n", t.dst.u.udp.port,
expected(struct sk_buff** pskb, uint hooknum,
struct ip_conntrack* ct, struct ip_nat_info* info)
{
- struct iphdr* iph = (struct iphdr*)(*pskb)->nh.iph;
- struct udphdr *udph = (void *)iph + iph->ihl * 4;
struct ip_nat_multi_range mr;
u_int32_t newdstip, newsrcip, newip;
DUMP_TUPLE(&master->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
DUMP_TUPLE(&master->tuplehash[IP_CT_DIR_REPLY].tuple);
- /*
- * Ignore the UDP checksum for now.
- */
- udph->dest = ct->nat.rtsp_info.orig_port;
- udph->check = 0;
-
mr.rangesize = 1;
/*
* We don't want to manip the per-protocol, just the IPs. Actually we
*/
mr.range[0].flags = IP_NAT_RANGE_MAP_IPS;
mr.range[0].min_ip = mr.range[0].max_ip = newip;
+ mr.range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
+ mr.range[0].min.udp.port = mr.range[0].max.udp.port = ct->nat.rtsp_info.orig_port;
return ip_nat_setup_info(ct, &mr, hooknum);
}
}
static uint
-help(struct ip_conntrack* ct, struct ip_conntrack_expect* exp,
- struct ip_nat_info* info, enum ip_conntrack_info ctinfo,
- unsigned int hooknum, struct sk_buff** pskb)
+help(struct ip_conntrack* ct,
+ struct ip_conntrack_expect* exp,
+ struct ip_nat_info* info,
+ enum ip_conntrack_info ctinfo,
+ unsigned int hooknum,
+ struct sk_buff** pskb)
{
struct iphdr* iph = (struct iphdr*)(*pskb)->nh.iph;
struct tcphdr* tcph = (struct tcphdr*)((char*)iph + iph->ihl * 4);
datalen = (*pskb)->len - iph->ihl * 4 - tcph->doff * 4;
LOCK_BH(&ip_rtsp_lock);
- /* Ensure the packet contains all of the marked data */
- if (!between(exp->seq + ct_rtsp_info->len,
- ntohl(tcph->seq), ntohl(tcph->seq) + datalen))
- {
- /* Partial retransmission? Probably a hacker. */
- if (net_ratelimit())
- {
- INFOP("partial packet %u/%u in %u/%u\n",
- exp->seq, ct_rtsp_info->len, ntohl(tcph->seq), ntohl(tcph->seq) + datalen);
- }
- UNLOCK_BH(&ip_rtsp_lock);
- return NF_DROP;
- }
switch (dir)
{
hlpr->mask.src.u.tcp.port = 0xFFFF;
hlpr->mask.dst.protonum = 0xFFFF;
hlpr->help = help;
-#ifdef CONFIG_MIPS_BRCM
- //hlpr->flags = 0;
- //hlpr->me = THIS_MODULE;
-#else
hlpr->flags = 0;
hlpr->me = THIS_MODULE;
-#endif
hlpr->expect = expected;
tmpname = &rtsp_names[i][0];