On Fri, Jul 25, 2008 at 5:35 PM, Frank Denis <[EMAIL PROTECTED]> wrote: > Hello, > > Well, I didn't have enough sleep lately, so probably this is an obvious > and expected result. > > But connecting to a closed TCP port (that replies with RST) from OpenBSD > doesn't immediately return. > > Extremely trivial demo (assuming nothing listens on 4242): > > $ nc 127.0.0.1 4242 > > It waits a while before throwing Connection refused. Same thing for a > remote host: > > $ nc openbsd.org 4242 > > The same command with any another OS immediately returns ECONNREFUSED. > > PF isn't enabled. The behavior is the same with -current, OpenBSD 4.1 and > OpenBSD 3.9, so this is not new. > > Is it intentional? What is the point? > > Another thing, with -current : > > $ sudo tcpdump -nvi vge0 dst host 199.185.137.3 & > $ nc 199.185.137.3 4242 > tcpdump: listening on vge0, link-type EN10MB > 01:24:53.473955 88.191.38.240.48850 > 199.185.137.3.4242: SWE [bad tcp cksum > d965!] 1361218769:1361218769(0) win 16384 <mss > 1460,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 138557634 0> (DF) (ttl > 64, id 18485, len 64, bad cksum 14!) > 01:24:59.462216 88.191.38.240.48850 > 199.185.137.3.4242: S [bad tcp cksum > 8d66!] 1361218769:1361218769(0) win 16384 <mss > 1460,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 138557646 0> (DF) (ttl > 64, id 52715, len 64, bad cksum 14!) > > This is with a vge NIC on OpenBSD/i386. I tried on completely different > hardware, on OpenBSD/amd64 with a re NIC and also got those bad checksums > everytime.
Can't reproduce on a 4.2 -stable box with fxp NICs: $ time nc -v openbsd.org 4242 nc: connect to openbsd.org port 4242 (tcp) failed: Connection refused 0m0.11s real 0m0.00s user 0m0.00s system $ sudo tcpdump -i pppoe0 port 4242 tcpdump: listening on pppoe0, link-type PPP_ETHER 17:48:40.849784 97.118.x.x.41008 > 199.185.137.3.4242: S 2945779380:2945779380(0) win 65535 <mss 1452,nop,nop,sackOK,nop,wscale 1,nop,nop,timestamp 1351199331 0> (DF) 17:48:40.959003 199.185.137.3.4242 > 97.118.x.x.41008: R 0:0(0) ack 2945779381 win 0 (DF)