git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Small patch to add support for MPTCP on Linux

From
Muhammad Nuzaihan <zaihan@unrealasia.net>
Date
May 16, 2025, 17:56 UTC
Message-ID
<JH8DWS.72DKHPTI873H3@unrealasia.net>
Patch to enable the use of MPTCP on Linux (when available)

IPPROTO_MPTCP v1 (not the old v0) has been improved to go about the limitations of middleboxes.

MPTCP protocol is an extension of vanilla TCP which enables multiple IP to aggregate bandwidth at layer 4 of the OSI stack across as said IP(s).

Similar to link aggregation which works at layer 2. MPTCP works on top of IP layer.

Other than aggregating bandwidth, MPTCP also allows seamless failover when one network path (not just link) is down (or having high latency) by reinjecting the packets to a path that is available.

This patch enables IPPROTO_MPTCP if IPPROTO_MPTCP is available and uses plain TCP if the Linux system does not support it.

Signed-off-by: Muhammad Nuzaihan Bin Kamal Luddin 
<zaihan@unrealasia.net>
diff --git a/connect.c b/connect.c
index 3280435331..8473f0b02e 100644
--- a/connect.c
+++ b/connect.c
@@ -827,8 +827,11 @@ static int git_tcp_connect_sock(char *host, int flags)
 	else if (flags & CONNECT_IPV6)
 		hints.ai_family = AF_INET6;
 	hints.ai_socktype = SOCK_STREAM;
-	hints.ai_protocol = IPPROTO_TCP;
-
+#ifdef IPPROTO_MPTCP
+        hints.ai_protocol = IPPROTO_MPTCP;
+#else
+        hints.ai_protocol = IPPROTO_TCP;
+#endif
 	if (flags & CONNECT_VERBOSE)
 		fprintf(stderr, _("Looking up %s ... "), host);
 
Next: brian m. carlson
Message 1 of 14 in “Small patch to add support for MPTCP on Linux”
  1. Muhammad NuzaihanMay 16, 2025
  2. brian m. carlsonMay 16, 2025
  3. Muhammad NuzaihanMay 17, 2025
  4. brian m. carlsonMay 17, 2025
  5. Muhammad NuzaihanMay 17, 2025
  6. Phillip WoodMay 17, 2025
  7. Junio C HamanoMay 19, 2025
  8. Muhammad NuzaihanMay 20, 2025
  9. Matthieu BaertsMay 20, 2025
  10. Junio C HamanoMay 20, 2025
  11. Matthieu BaertsMay 20, 2025
  12. Junio C HamanoMay 20, 2025
  13. Matthieu BaertsMay 22, 2025
  14. Muhammad NuzaihanMay 17, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.