summaryrefslogtreecommitdiffstats
path: root/debian/patches/progress-linux/0006-mptcp-headers.patch
blob: e114affe381ef8ef80081460ea7250dcc8a25ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Author: mpostaire <maxime_postaire@hotmail.fr>
Description: Code cleanup + IPPROTO_MPTCP in defines header.
 https://github.com/openssh/openssh-portable/pull/335

diff -Naurp openssh.orig/defines.h openssh/defines.h
--- openssh.orig/defines.h
+++ openssh/defines.h
@@ -898,6 +898,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 -Naurp openssh.orig/sshconnect.c openssh/sshconnect.c
--- openssh.orig/sshconnect.c
+++ openssh/sshconnect.c
@@ -358,10 +358,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 -Naurp openssh.orig/sshd.c openssh/sshd.c
--- openssh.orig/sshd.c
+++ openssh/sshd.c
@@ -1092,13 +1092,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));