freebsd-ports/net/mlvpn/files/patch-src_config.c
Olivier Cochard 3c978d9c6d 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
2016-05-09 10:57:52 +00:00

57 lines
2.8 KiB
C

--- src/config.c.orig 2015-12-28 11:20:16 UTC
+++ src/config.c
@@ -269,6 +269,7 @@ mlvpn_config(int config_file_fd, int fir
} else if (strncmp(lastSection, "filters", 7) != 0) {
char *bindaddr;
char *bindport;
+ uint32_t bindfib = 0;
char *dstaddr;
char *dstport;
uint32_t bwlimit = 0;
@@ -284,6 +285,9 @@ mlvpn_config(int config_file_fd, int fir
_conf_set_str_from_conf(
config, lastSection, "bindport", &bindport, NULL,
"bind port is mandatory in server mode.\n", 1);
+ _conf_set_uint_from_conf(
+ config, lastSection, "bindfib", &bindfib, 0,
+ NULL, 0);
_conf_set_str_from_conf(
config, lastSection, "remotehost", &dstaddr, NULL,
NULL, 0);
@@ -297,6 +301,9 @@ mlvpn_config(int config_file_fd, int fir
_conf_set_str_from_conf(
config, lastSection, "bindport", &bindport, NULL,
NULL, 0);
+ _conf_set_uint_from_conf(
+ config, lastSection, "bindfib", &bindfib, 0,
+ NULL, 0);
_conf_set_str_from_conf(
config, lastSection, "remotehost", &dstaddr, NULL,
"No remote address specified.\n", 1);
@@ -336,6 +343,7 @@ mlvpn_config(int config_file_fd, int fir
tmptun->name);
if ((! mystr_eq(tmptun->bindaddr, bindaddr)) ||
(! mystr_eq(tmptun->bindport, bindport)) ||
+ (tmptun->bindfib != bindfib) ||
(! mystr_eq(tmptun->destaddr, dstaddr)) ||
(! mystr_eq(tmptun->destport, dstport))) {
mlvpn_rtun_status_down(tmptun);
@@ -347,6 +355,9 @@ mlvpn_config(int config_file_fd, int fir
if (bindport) {
strlcpy(tmptun->bindport, bindport, sizeof(tmptun->bindport));
}
+ if (tmptun->bindfib != bindfib) {
+ tmptun->bindfib = bindfib;
+ }
if (dstaddr) {
strlcpy(tmptun->destaddr, dstaddr, sizeof(tmptun->destaddr));
}
@@ -380,7 +391,7 @@ mlvpn_config(int config_file_fd, int fir
{
log_info("config", "%s tunnel added", lastSection);
mlvpn_rtun_new(
- lastSection, bindaddr, bindport, dstaddr, dstport,
+ lastSection, bindaddr, bindport, bindfib, dstaddr, dstport,
default_server_mode, timeout, fallback_only,
bwlimit, loss_tolerence);
}