At 10AM -0800 on 1/12/12 Erik A Johnson wrote:
>> Should the "#ifdef __APPLE__" remain? or would any of these tests be
>> appropriate for other platforms as well?


On 12/1/2012 at 11:07:36am PST, Ben Morrow <b...@morrow.me.uk> wrote:
> I had a go at reproducing this on FreeBSD and failed, but I don't believe 
> we've seen a packet trace yet so I wasn't entirely sure what might provoke 
> it. There is definitely a bug in the OS here somewhere, unless the socket 
> never gets as far as SYN-SYN/ACK-ACK, since ENOTCONN should only be returned 
> *before* the socket has connected successfully. An ordinary disconnected 
> socket should simply return EOF from read, and a socket that got RST should 
> return ECONNRESET.
> 
> Are you able to reproduce this and get a tcpdump packet trace (on the dovecot 
> side of any firewalls)?

Attached is the output of "sudo tcpdump -i en0 -vv -A host CLIENT" run on the 
SERVER.

I know enough about tcpdump to be dangerous; if there is additional output that 
would be helpful, please let me know what options to use for tcpdump (the OS X 
tcpdump man page is at 
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/tcpdump.1.html).

> Also, when this happens, does it happen straight away or is there a delay 
> until the connection times out?

It happens straight away.

> (I don't suppose you know if the source for the OSX network stack is online 
> anywhere? I'd be interested to see how different it is from FreeBSD's.)

Would it be somewhere at http://opensource.apple.com/release/mac-os-x-1082/ ?


02:40:58.721596 IP (tos 0x0, ttl 64, id 17809, offset 0, flags [DF], proto TCP 
(6), length 64)
    CLIENT.51819 > SERVER.imaps: Flags [S], cksum 0xe780 (correct), seq 
2439614483, win 65535, options [mss 1460,nop,wscale 3,nop,nop,TS val 1051593167 
ecr 0,sackOK,eol], length 0
E..@E.@.@...
...
..l.k...i.........................
>.      .........
02:40:58.721803 IP (tos 0x0, ttl 64, id 55036, offset 0, flags [DF], proto TCP 
(6), length 64)
    SERVER.imaps > CLIENT.51819: Flags [S.], cksum 0x277c (correct), seq 
947774533, ack 2439614484, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS 
val 877424355 ecr 1051593167,sackOK,eol], length 0
E..@..@.@.L.
..l
......k8}.E.i......'|.............
4Ln.>.  .....
02:40:58.726646 IP (tos 0x0, ttl 64, id 34733, offset 0, flags [DF], proto TCP 
(6), length 52)
    CLIENT.51819 > SERVER.imaps: Flags [.], cksum 0x6748 (correct), seq 1, ack 
1, win 65535, options [nop,nop,TS val 1051593169 ecr 877424355], length 0
E..4..@.@...
...
..l.k...i..8}.F....gH.....
>.      .4Ln.
02:40:58.726754 IP (tos 0x0, ttl 64, id 6073, offset 0, flags [DF], proto TCP 
(6), length 52)
    SERVER.imaps > CLIENT.51819: Flags [.], cksum 0x4718 (correct), seq 1, ack 
1, win 8235, options [nop,nop,TS val 877424360 ecr 1051593169], length 0
E..4..@.@...
..l
......k8}.F.i.... +G......
4Ln.>.  .
02:40:58.732338 IP (tos 0x0, ttl 64, id 20960, offset 0, flags [DF], proto TCP 
(6), length 52)
    SERVER.imaps > CLIENT.51819: Flags [F.], cksum 0x4712 (correct), seq 1, ack 
1, win 8235, options [nop,nop,TS val 877424365 ecr 1051593169], length 0
E..4Q.@.@...
..l
......k8}.F.i.... +G......
4Ln.>.  .
02:40:58.746788 IP (tos 0x0, ttl 64, id 37781, offset 0, flags [DF], proto TCP 
(6), length 182)
    CLIENT.51819 > SERVER.imaps: Flags [P.], cksum 0xfb11 (correct), seq 1:131, 
ack 1, win 65535, options [nop,nop,TS val 1051593169 ecr 877424355], length 130
E.....@.@..u
...
..l.k...i..8}.F...........
>.      .4Ln.......W... ..9..8..5........
.....3..2../.............................       
..@........................u..Q....#.+.x......!.U.....yCkh.
02:40:58.746793 IP (tos 0x0, ttl 64, id 50564, offset 0, flags [DF], proto TCP 
(6), length 52)
    CLIENT.51819 > SERVER.imaps: Flags [.], cksum 0x66ba (correct), seq 131, 
ack 2, win 65535, options [nop,nop,TS val 1051593170 ecr 877424365], length 0
E..4..@.@.^.
...
..l.k...i..8}.G....f......
>.      .4Ln.
02:40:58.746842 IP (tos 0x0, ttl 64, id 49645, offset 0, flags [DF], proto TCP 
(6), length 40)
    SERVER.imaps > CLIENT.51819: Flags [R], cksum 0xad98 (correct), seq 
947774534, win 0, length 0
E..(..@.@.a.
..l
......k8}.F....P.......
02:40:58.746843 IP (tos 0x0, ttl 64, id 42942, offset 0, flags [DF], proto TCP 
(6), length 40)
    SERVER.imaps > CLIENT.51819: Flags [R], cksum 0xad97 (correct), seq 
947774535, win 0, length 0
E..(..@.@.{.
..l
......k8}.G....P.......
02:40:58.747318 IP (tos 0x0, ttl 64, id 27131, offset 0, flags [DF], proto TCP 
(6), length 52)
    CLIENT.51819 > SERVER.imaps: Flags [F.], cksum 0x66b9 (correct), seq 131, 
ack 2, win 65535, options [nop,nop,TS val 1051593170 ecr 877424365], length 0
E..4i.@.@...
...
..l.k...i..8}.G....f......
>.      .4Ln.
02:40:58.747335 IP (tos 0x0, ttl 64, id 48383, offset 0, flags [DF], proto TCP 
(6), length 40)
    SERVER.imaps > CLIENT.51819: Flags [R], cksum 0xad97 (correct), seq 
947774535, win 0, length 0
E..(..@.@.f.
..l
......k8}.G....P.......

Reply via email to