Calling multiple times ip_nat_mangle_tcp_packet()

Jozsef Kadlecsik kadlec@blackhole.kfki.hu
Mon, 5 Jul 2004 10:41:06 +0200 (CEST)


On Fri, 2 Jul 2004 Atanu.Mondal@infineon.com wrote:

> I am mangling SIP Message Header and data and for this I am calling
> ip_nat_mangle_tcp_packet() funtion for
> each line which need to adjust its IP Address.. The problem I am facing
> is with TCP seq numbering..
> The ip_nat_resize_packet() function takes care of the seq numbering
> inside ip_nat_mangle_tcp_packet() but
> it takes care of the adjustment for only the 1st call.. Any subsequent
> call to ip_nat_mangle_tcp_packet
> does not adjust the offset_before and offset_after parameters and the it
> remains what it was in the first
> call.
> In the return direction the ack and seq no is adjusted as per the offset
> set in the 1st call..which is wrong.
>
> Can somebody help me out in understanding how to do it... Or do I need
> to writeout my  own function. ???

Write your own mangle_tcp_packet function: the current one supports one
adjustment in the window, as the comment in the source code says as well.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
          H-1525 Budapest 114, POB. 49, Hungary