[PATCH] tcp options fix

Scott Lamb slamb at slamb.org
Wed Jan 11 08:08:14 CET 2006


Attached is a patch that corrects two problems with TCP options:

* The options on accepted sockets don't inherit from the listen  
socket, at least on Linux and OS X.
* OS X doesn't have SOL_TCP defined, so Nagle was not getting  
disabled. IPPROTO_TCP should always be the same thing.

This patch makes my ping times across a TCP VPN go from ~180 ms to  
~85ms.

Something still doesn't seem right, though. When I do a ping, I see  
five packets. I would have expected three (ping, pong + ack if there  
wasn't one, ack). Why the double send each way?

23:00:44.063609 IP 192.168.1.105.49588 > 216.136.66.56.655: P  
689862950:689862956(6) ack 679331700 win 65535 <nop,nop,timestamp  
1983522451 179617421>
23:00:44.064206 IP 192.168.1.105.49588 > 216.136.66.56.655: P 6:104 
(98) ack 1 win 65535 <nop,nop,timestamp 1983522451 179617421>
23:00:44.142247 IP 216.136.66.56.655 > 192.168.1.105.49588: P 1:7(6)  
ack 104 win 7504 <nop,nop,timestamp 179623247 1983522451>
23:00:44.143676 IP 216.136.66.56.655 > 192.168.1.105.49588: P 7:105 
(98) ack 104 win 7504 <nop,nop,timestamp 179623247 1983522451>
23:00:44.236028 IP 192.168.1.105.49588 > 216.136.66.56.655: . ack 105  
win 65535 <nop,nop,timestamp 1983522451 179623247>

Regards,
Scott


More information about the tinc-devel mailing list