From 5e0b7f30a18b7855ce661fe4bfe9c90764e4c937 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:08:32 +0200 Subject: Adding patches from Colin Evrard for optional Multipath TCP support. Signed-off-by: Daniel Baumann --- .../progress-linux/0007-mptcp-headers.patch | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 debian/patches/progress-linux/0007-mptcp-headers.patch (limited to 'debian/patches/progress-linux/0007-mptcp-headers.patch') diff --git a/debian/patches/progress-linux/0007-mptcp-headers.patch b/debian/patches/progress-linux/0007-mptcp-headers.patch new file mode 100644 index 0000000..2d2512b --- /dev/null +++ b/debian/patches/progress-linux/0007-mptcp-headers.patch @@ -0,0 +1,56 @@ +Author: mpostaire +Description: Code cleanup + IPPROTO_MPTCP in defines header. + https://github.com/openssh/openssh-portable/pull/335 + +diff --git a/defines.h b/defines.h +index 279e509a..d73550a9 100644 +--- a/defines.h ++++ b/defines.h +@@ -892,6 +892,10 @@ struct winsize { + # define SSH_IOBUFSZ 8192 + #endif + ++#ifndef IPPROTO_MPTCP ++#define IPPROTO_MPTCP 262 ++#endif ++ + /* + * We want functions in openbsd-compat, if enabled, to override system ones. + * We no-op out the weak symbol definition rather than remove it to reduce +diff --git a/sshconnect.c b/sshconnect.c +index 308bd755..63035a9d 100644 +--- a/sshconnect.c ++++ b/sshconnect.c +@@ -359,10 +359,8 @@ ssh_create_socket(struct addrinfo *ai) + #endif + char ntop[NI_MAXHOST]; + +- if (options.use_mptcp) +- sock = socket(ai->ai_family, ai->ai_socktype, IPPROTO_MPTCP); +- else +- sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); ++ sock = socket(ai->ai_family, ai->ai_socktype, ++ options.use_mptcp ? IPPROTO_MPTCP : ai->ai_protocol); + if (sock == -1) { + error("socket: %s", strerror(errno)); + return -1; +diff --git a/sshd.c b/sshd.c +index 3f12299b..102079ac 100644 +--- a/sshd.c ++++ b/sshd.c +@@ -1046,13 +1046,8 @@ listen_on_addrs(struct listenaddr *la) + continue; + } + /* Create socket for listening. */ +- if (options.use_mptcp) { +- listen_sock = socket(ai->ai_family, ai->ai_socktype, +- IPPROTO_MPTCP); +- } else { +- listen_sock = socket(ai->ai_family, ai->ai_socktype, +- ai->ai_protocol); +- } ++ listen_sock = socket(ai->ai_family, ai->ai_socktype, ++ options.use_mptcp ? IPPROTO_MPTCP : ai->ai_protocol); + if (listen_sock == -1) { + /* kernel may not support ipv6 */ + verbose("socket: %.100s", strerror(errno)); -- cgit v1.2.3