diff options
author | Olivier Cochard <olivier@FreeBSD.org> | 2016-05-09 10:57:52 +0000 |
---|---|---|
committer | Olivier Cochard <olivier@FreeBSD.org> | 2016-05-09 10:57:52 +0000 |
commit | 3c978d9c6d98ca237f49d580529c9886a565c643 (patch) | |
tree | f51bf7a4ddba9baa859c38a417ce9e7c590378f7 /net/mlvpn/files/patch-src_mlvpn.c | |
parent | - Update to 5.0.0 (diff) |
New port: net/mlvpn
MLVPN allow to bond your internet links to increase bandwidth, secure your
internet connection by actively monitoring your links and removing the faulty
ones, without loosing your TCP connections and secure your internet connection
to the aggregation server using cryptography.
WWW: https://zehome.github.io/MLVPN/
Approved by: mat
Differential Revision: https://reviews.freebsd.org/D6034
Diffstat (limited to 'net/mlvpn/files/patch-src_mlvpn.c')
-rw-r--r-- | net/mlvpn/files/patch-src_mlvpn.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net/mlvpn/files/patch-src_mlvpn.c b/net/mlvpn/files/patch-src_mlvpn.c new file mode 100644 index 000000000000..ad12663e6bf0 --- /dev/null +++ b/net/mlvpn/files/patch-src_mlvpn.c @@ -0,0 +1,54 @@ +--- src/mlvpn.c.orig 2015-12-28 11:20:16 UTC ++++ src/mlvpn.c +@@ -597,7 +597,7 @@ mlvpn_rtun_write(EV_P_ ev_io *w, int rev + + mlvpn_tunnel_t * + mlvpn_rtun_new(const char *name, +- const char *bindaddr, const char *bindport, ++ const char *bindaddr, const char *bindport, uint32_t bindfib, + const char *destaddr, const char *destport, + int server_mode, uint32_t timeout, + int fallback_only, uint32_t bandwidth, +@@ -653,6 +653,7 @@ mlvpn_rtun_new(const char *name, + strlcpy(new->bindaddr, bindaddr, sizeof(new->bindaddr)); + if (bindport) + strlcpy(new->bindport, bindport, sizeof(new->bindport)); ++ new->bindfib = bindfib; + if (destaddr) + strlcpy(new->destaddr, destaddr, sizeof(new->destaddr)); + if (destport) +@@ -780,6 +781,7 @@ static int + mlvpn_rtun_start(mlvpn_tunnel_t *t) + { + int ret, fd = -1; ++ int fib = 0; + char *addr, *port; + struct addrinfo hints, *res; + +@@ -788,9 +790,11 @@ mlvpn_rtun_start(mlvpn_tunnel_t *t) + { + addr = t->bindaddr; + port = t->bindport; ++ fib = t->bindfib; + } else { + addr = t->destaddr; + port = t->destport; ++ fib = t->bindfib; + } + + /* Initialize hints */ +@@ -817,6 +821,14 @@ mlvpn_rtun_start(mlvpn_tunnel_t *t) + log_warn(NULL, "%s socket creation error", + t->name); + } else { ++#if defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD) ++ /* Setting SO_SETFIB (fib) supported on FreeBSD and OpenBSD only */ ++ if (setsockopt(fd, SOL_SOCKET, SO_SETFIB, &fib, sizeof(fib)) < 0) ++ { ++ log_warnx(NULL, "Cannot set FIB %d for kernel socket", fib); ++ goto error; ++ } ++#endif + t->fd = fd; + break; + } |