Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support IPPROTO_MPTCP #349

Merged
merged 1 commit into from
Sep 10, 2022
Merged

support IPPROTO_MPTCP #349

merged 1 commit into from
Sep 10, 2022

Conversation

Martichou
Copy link
Contributor

Simply add the support for MPTCP protocol by adding and exposing the MPTCP const Protocol.

MPTCP allow end user to open multiple path (TCP) to the destination server using multiple interface. For example, one can use the LTE connection of his phone as well as a Wifi connection. Or Ethernet and Wifi.

Setting this Protocol will fail if the host does not support MPTCP, thus the fallback is to open as TCP like one would normally do.

For reference: sysctl net.mptcp.enabled=1

I'm not sure about adding test as this imply that the host must support MPTCP, open for feedback on this :)

Signed-off-by: Martin Andre martin.andre@tessares.net

Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do know if any other Linux like OS supports this? For example Android or Fuschia?

tests/socket.rs Outdated Show resolved Hide resolved
Simply add the support for MPTCP protocol by adding
and exposing the MPTCP const Protocol.

MPTCP allow end user to open multiple path (TCP) to
the destination server using multiple interface. For
example, one can use the LTE connection of his phone
as well as a Wifi connection. Or Ethernet and Wifi.

Setting this Protocol will fail if the host does not
support MPTCP, thus the fallback is to open as TCP
like one would normally do.

For reference:
`sysctl net.mptcp.enabled=1`

Signed-off-by: Martin Andre <martin.andre@tessares.net>
@Martichou
Copy link
Contributor Author

Do know if any other Linux like OS supports this? For example Android or Fuschia?

It all depends on the Kernel, at the moment only Linux Kernel >=5.6 have MPTCP.
I can see in the Rust's libc that l4re seems to share the same export as linux (see https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/mod.rs#L1818), thus they also share the libc::IPPROTO_MPTCP const, but I know nothing about l4re so I'm not sure.

As Android is based on the Linux Kernel it should be compatible, but the Rust libc team did not define the IPPROTO_MPTCP for Android. I think that support for others OS can be added later if found compatible.

@Thomasdezeeuw
Copy link
Collaborator

Do know if any other Linux like OS supports this? For example Android or Fuschia?

It all depends on the Kernel, at the moment only Linux Kernel >=5.6 have MPTCP. I can see in the Rust's libc that l4re seems to share the same export as linux (see https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/mod.rs#L1818), thus they also share the libc::IPPROTO_MPTCP const, but I know nothing about l4re so I'm not sure.

We don't support l4re.

As Android is based on the Linux Kernel it should be compatible, but the Rust libc team did not define the IPPROTO_MPTCP for Android. I think that support for others OS can be added later if found compatible.

We can add Android later.

@Thomasdezeeuw Thomasdezeeuw merged commit 4c43681 into rust-lang:master Sep 10, 2022
@Thomasdezeeuw
Copy link
Collaborator

Thanks @Martichou.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants