Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] add MPTCP support #132

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "log.h"
#include "connections.h"
#include "plugin.h"
#include "plugin_config.h"
#include "sock_addr.h"

#include "network_write.h"
Expand Down Expand Up @@ -539,6 +540,17 @@ static int network_server_init(server *srv, const network_socket_config *s, buff
} else
#endif
{
#ifdef __linux__
if (config_feature_bool(srv, "server.network-mptcp", 1)) {
/* manually define mptcp protocol number in case the compiler is using an older version of libc */
#ifndef IPPROTO_MPTCP
#define IPPROTO_MPTCP 262
#endif
if (-1 == (srv_socket->fd = fdevent_socket_nb_cloexec(family, SOCK_STREAM, IPPROTO_MPTCP)))
log_pdebug(srv->errh, __FILE__, __LINE__, "socket() IPPROTO_MPTCP");
}
if (-1 != srv_socket->fd) { } else /*fallback to tcp*/
#endif
if (-1 == (srv_socket->fd = fdevent_socket_nb_cloexec(family, SOCK_STREAM, IPPROTO_TCP))) {
#ifndef _WIN32
/* some configs might always include IPv6 addresses,
Expand Down