var mptcpOnce … var mptcpAvailable … var hasSOLMPTCP … const _IPPROTO_MPTCP … const _SOL_MPTCP … const _MPTCP_INFO … func supportsMultipathTCP() bool { … } // Check that MPTCP is supported by attempting to create an MPTCP socket and by // looking at the returned error if any. func initMPTCPavailable() { … } func (sd *sysDialer) dialMPTCP(ctx context.Context, laddr, raddr *TCPAddr) (*TCPConn, error) { … } func (sl *sysListener) listenMPTCP(ctx context.Context, laddr *TCPAddr) (*TCPListener, error) { … } // hasFallenBack reports whether the MPTCP connection has fallen back to "plain" // TCP. // // A connection can fallback to TCP for different reasons, e.g. the other peer // doesn't support it, a middle box "accidentally" drops the option, etc. // // If the MPTCP protocol has not been requested when creating the socket, this // method will return true: MPTCP is not being used. // // Kernel >= 5.16 returns EOPNOTSUPP/ENOPROTOOPT in case of fallback. // Older kernels will always return them even if MPTCP is used: not usable. func hasFallenBack(fd *netFD) bool { … } // isUsingMPTCPProto reports whether the socket protocol is MPTCP. // // Compared to hasFallenBack method, here only the socket protocol being used is // checked: it can be MPTCP but it doesn't mean MPTCP is used on the wire, maybe // a fallback to TCP has been done. func isUsingMPTCPProto(fd *netFD) bool { … } // isUsingMultipathTCP reports whether MPTCP is still being used. // // Please look at the description of hasFallenBack (kernel >=5.16) and // isUsingMPTCPProto methods for more details about what is being checked here. func isUsingMultipathTCP(fd *netFD) bool { … }