Date: Tue, 17 May 2011 14:22:16 +0200 From: Cole <cole@opteqint.net> To: freebsd-net@freebsd.org Subject: Kern Mod and TCP retrasmit problem Message-ID: <BANLkTi=qLfYCA=A5pCSk9OgMCV_9s4zkLg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi. Ive written a kernel module that modifies the data of outgoing TCP packets. I use pfil_hook to insert my module into the outgoing packet stream. Depending on the data, the size of data in the TCP packet may change, either increasing or decreasing. When modifying the data size, I update the mbuf len, the pkthdr len, the size in the IP header, as well as modifying the TCP checksum. I also update the tcpcb->snd_nxt, and tcpcb->snd_max values. The problem I am having at the moment is only when I modify the packet and the data size decreases. Whenever the data size increases I dont have a problem. However, when the data size decreases, the TCP architecture tries to retransmit the missing data. i.e. if original data in the TCP packet is 30 bytes in size, and i modify it and it is now only 18 bytes in size, then the box retransmits the missing 12 bytes that it thought never got transmitted. This is where my problem lies, im trying to find out what variable or structure I need to update so that the box doesnt think that it needs to retransmit those missing bytes. Ive been looking at the tcbcb structure in netinet/tcp_var.h and I cannot seem to see any values inside this structure that point to the data size of the packet. Ive also looked at tcp_output.c and I see that theres functions that use tcpcb->sackhint to see if theres missing bytes. However when examing those in the kernel module of the outgoing packet, the pointer is always NULL. If anyone has any ideas or suggestions, I would be glad to hear. Thanks /Cole
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTi=qLfYCA=A5pCSk9OgMCV_9s4zkLg>