]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/net/mptcpsock_linux.go
net: mptcp: implement listenMPTCP
[gostls13.git] / src / net / mptcpsock_linux.go
index a1c3805795459b78814d75f142f0443a4a82ee97..4663d28b4b419785fcaa7b1291b606022d3ca923 100644 (file)
@@ -51,3 +51,12 @@ func (sd *sysDialer) dialMPTCP(ctx context.Context, laddr, raddr *TCPAddr) (*TCP
 
        return sd.doDialTCPProto(ctx, laddr, raddr, _IPPROTO_MPTCP)
 }
+
+func (sl *sysListener) listenMPTCP(ctx context.Context, laddr *TCPAddr) (*TCPListener, error) {
+       // Fallback to listenTCP if Multipath TCP isn't supported on this operating system.
+       if !supportsMultipathTCP() {
+               return sl.listenTCP(ctx, laddr)
+       }
+
+       return sl.listenTCPProto(ctx, laddr, _IPPROTO_MPTCP)
+}