Author: mpostaire 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));