Libipq problem
Hi all!
First of all I want to apologize for my English.
I know libipq has been changed but I'm working with a embedded Linux 2.4.xx kernel in a Linksys Router (using OpenWRT), and I can't change to the newest version. The fact is I have developed an application which read the HTTP payload and erase the HTTP-headers (in HTTP/1.1 only host header has to be sent).
(TCP spoofing in order to simulate a TCP split PEP-proxy)
It works, correcting the checksums, the total lenght of the packet...but when it reinjects and send the package it produces some incompleted copies of the sent package in the queue. My receiver is reciving 2 "bad-repeated" packages (3 packages at all).
I've read this behaviour appears when the packet changes its size (other developers' experience and posts), but I don't have find any answer.
Is this behaviour normal??any idea?
tor 2007-04-19 klockan 11:21 +0200 skrev miguel Angel Vazquez:
Quoted 4 lines
It works, correcting the checksums, the total lenght of the packet...but when it reinjects and send the package it produces some incompleted copies of the sent package in the queue. My receiver is reciving 2 "bad-repeated" packages (3 packages at all).
Hmm.. how do you handle TCP sequence numbers in this rewrite chain?
Regards
Henrik
A message that is not in the archive (sent off-list or not yet received): [email protected]
fre 2007-04-27 klockan 11:45 +0200 skrev miguel Angel Vazquez:
Quoted 2 lines
Uops...that's a good question. I've not implemented a sequence number control but I'm trying to handle it with some local variables.
I'd suggest you better try doing what you are doing as a NAT helper instead.. that way you leverage from all the packet rewriting and sequence number adjusting done by the NAT kernel.
Doing this correctly via libipq will be very hard.
Quoted 4 lines
Well the fact is it seems that when I send a smaller packet than the original queued one, the rest of the packet still remains in the queue. Any idea about how to drop the rest of the package out of the queue??
Are you sure it's still in the queue and not a retransmission? When your smaller packet is forwarded only that amount of data gets ACK:ed by the recipient, and the sender sees that something went wrong and retransmits the unacknowledged data after a short delay.
Regards
Henrik