portforwarding in a nat-module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
at the moment i'm poking around with some
extensions in the sip-conntrack-module.

Want to have: forwarding of pakets to different
destinations, depending on their conntrack-state.
In the conntrack-help:
if (localnet  == (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip & localnet_mask))
return NF_ACCEPT

should say: no change to pakets comming from inside.

all others, i want to forward to an internal host,
so i write:
if (ip_nat_forward_hook)
 ip_nat_forward_hook(pskb, ct, ctinfo, dptr,my_inet_addr(sip_proxy_ip));


and in nat_forward: (clearly another module)
 ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.ip = fwd_ip;
 (*pskb)->nh.iph->daddr = fwd_ip;

after that, the udp csum and ip-csum are recalculated.

So now the problem: it simply don't work.
but wheres the error in reasoning ?
tcpdump sees the pakets, dest-addr is the internal.
cat conntrack: the tuple looks like it should

Or is there another way i can achieve the thing ?

thanks in advance
Martin
-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux