1

According to the documentation, the "IPPROTO_MPTCP" protocol has been added to Python3.10, but when I create a socket like this,

socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_MPTCP)

I get this error

module 'socket' has no attribute 'IPPROTO_MPTCP'

What could I be doing wrong in this? Here's a screenshot.

Here's a screenshot as well

Harsh Ranjan
  • 11
  • 2
  • 1
  • It looks like Python needs to be compiled with that option. For example `socket.IPPROTO_EGP` works and I can see that it [is defined here](https://github.com/python/cpython/blob/1aa6be06c4cb7f04a340adb1c7b16b89803ef254/Modules/socketmodule.c#L296) but `IPPROTO_MPTCP` is not defined in that file. – Boris Verkhovskiy Mar 11 '22 at 01:29

1 Answers1

0

Like @Boris Verkhovskiy guessed, for now Python needs to be compiled with the IPPROTO_MPTCP option. You can see that by going to the changelog, then opening the ticket, you can check the diff

If you are on linux, please also check your kernel version (>= 5.6) and whether MPTCP is enabled (sysctl net.mptcp.enabled). Check this checklist for more details.

bernard paulus
  • 1,644
  • 1
  • 21
  • 33