git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Nuzaihan <zaihan@unrealasia.net>
To: git@vger.kernel.org
Subject: Small patch to add support for MPTCP on Linux
Date: Sat, 17 May 2025 01:56:07 +0800	[thread overview]
Message-ID: <JH8DWS.72DKHPTI873H3@unrealasia.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]


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>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: git-mptcp.diff --]
[-- Type: text/x-patch, Size: 522 bytes --]

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);
 

             reply	other threads:[~2025-05-16 17:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 17:56 Muhammad Nuzaihan [this message]
2025-05-16 20:33 ` Small patch to add support for MPTCP on Linux brian m. carlson
2025-05-17  7:19   ` Muhammad Nuzaihan
     [not found]     ` <CAOYsWhkMb8hxjnYRTgAb269N=e-Vyw10Go5M=RA-8PyCjXPttA@mail.gmail.com>
2025-05-17  8:46       ` Muhammad Nuzaihan
2025-05-17 10:15     ` brian m. carlson
2025-05-17 13:10       ` Muhammad Nuzaihan
2025-05-17 13:39         ` Phillip Wood
2025-05-19 23:49           ` Junio C Hamano
2025-05-20  4:32             ` Muhammad Nuzaihan
2025-05-20 10:54             ` Matthieu Baerts
2025-05-20 15:44               ` Junio C Hamano
2025-05-20 20:34                 ` Matthieu Baerts
2025-05-20 22:02                   ` Junio C Hamano
2025-05-22 11:12                     ` Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=JH8DWS.72DKHPTI873H3@unrealasia.net \
    --to=zaihan@unrealasia.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).