Date: Fri, 26 Jul 2013 08:32:08 GMT From: Jukka Ukkonen <jau@iki.fi> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/180873: SCTP connection hangs on COOKIE_ECHOED Message-ID: <201307260832.r6Q8W8Bw054620@oldred.freebsd.org> Resent-Message-ID: <201307260840.r6Q8e0SP082377@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 180873 >Category: kern >Synopsis: SCTP connection hangs on COOKIE_ECHOED >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 26 08:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Jukka Ukkonen >Release: 9.2-BETA1 >Organization: ----- >Environment: FreeBSD sleipnir 9.2-BETA1 FreeBSD 9.2-BETA1 #0 r253639M: Thu Jul 25 10:56:29 EEST 2013 root@sleipnir:/usr/obj/usr/src/sys/Sleipnir amd64 >Description: SCTP connections using IPv6 hang on the third leg of the connection setup when trying to connect to the system itself over lo0. Netstat shows these lines about the pending/hanging connect... sctp46 1to1 fe80::225:90ff:f.6042 ::1.41368 ESTABLISHED fe80::225:90ff:f.6042 ::1.6042 fe80::1.6042 sctp46 1to1 ::1.41368 ::1.6042 COOKIE_ECHOED Tcpdump (tcpdump -i lo0) trace collected during the SCTP/IPv6 connection setup shows this... 09:35:21.999609 IP6 ::1.41140 > ::1.6042: sctp (1) [INIT] [init tag: 1501306277] [rwnd: 1864135] [OS: 10] [MIS: 2048] [init TSN: 2226957883] 09:35:22.000383 IP6 ::1.6042 > ::1.41140: sctp (1) [INIT ACK] [init tag: 3322565489] [rwnd: 1864135] [OS: 10] [MIS: 2048] [init TSN: 1843245874] 09:35:22.000870 IP6 ::1.41140 > ::1.6042: sctp (1) [COOKIE ECHO] 09:35:23.000476 IP6 ::1.41140 > ::1.6042: sctp (1) [COOKIE ECHO] 09:35:25.000820 IP6 ::1.41140 > ::1.6042: sctp (1) [COOKIE ECHO] 09:35:29.000743 IP6 ::1.41140 > ::1.6042: sctp (1) [COOKIE ECHO] Running the exact same connection test while using IPv4 addresses there is no problem. Everything works just fine. While using IPv6 the connect() call eventually ends with timeout. So, it seems something in the SCTP implementation is not exactly the same when the IP layer is IPv6 compared to the case when the IP layer is IPv4. The really odd thing about this is that this exact result only happens when the server is binding to multiple addresses and the client is using an implicit wild card bind while calling connect() without an explicit bind. If I change the test client to use explicit sctp_bindx() calls for all suitable local addresses the connection still hangs but netstat shows me this... sctp46 1to1 fe80::1.44586 ::1.6042 COOKIE_WAIT ::1.44586 fe80::225:90ff:f.44586 fe80::225:90ff:f.44586 sctp46 1to1 fe80::1.6042 LISTEN ::1.6042 fe80::225:90ff:f.6042 fe80::225:90ff:f.6042 At the same time tcpdump shows me no SCTP packets via lo0 at all. Needless to say maybe, but with explicit bind on the client side and IPv4 addresses everything works just fine. So, there is some sort of disparity between how SCTP connection setup works on top of IPv6 and IPv4. >How-To-Repeat: I am not quite sure of the conditions that trigger this odd behavior. >Fix: Not the foggiest idea yet. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307260832.r6Q8W8Bw054620>