Remove old bind options
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
2
mud
2
mud
Submodule mud updated: 7c90d54b91...2d4804af5a
47
src/main.c
47
src/main.c
@@ -28,11 +28,7 @@ static struct {
|
|||||||
char *keyfile;
|
char *keyfile;
|
||||||
char *host;
|
char *host;
|
||||||
long port;
|
long port;
|
||||||
struct {
|
long bind_port;
|
||||||
char *list;
|
|
||||||
char *backup;
|
|
||||||
long port;
|
|
||||||
} bind;
|
|
||||||
long mtu;
|
long mtu;
|
||||||
long timeout;
|
long timeout;
|
||||||
long time_tolerance;
|
long time_tolerance;
|
||||||
@@ -49,9 +45,7 @@ static struct {
|
|||||||
} buf;
|
} buf;
|
||||||
} gt = {
|
} gt = {
|
||||||
.port = 5000,
|
.port = 5000,
|
||||||
.bind = {
|
.bind_port = 5000,
|
||||||
.port = 5000,
|
|
||||||
},
|
|
||||||
.mtu = 1500,
|
.mtu = 1500,
|
||||||
.timeout = 5000,
|
.timeout = 5000,
|
||||||
.ipv4 = 1,
|
.ipv4 = 1,
|
||||||
@@ -183,9 +177,7 @@ gt_setup_option(int argc, char **argv)
|
|||||||
struct option opts[] = {
|
struct option opts[] = {
|
||||||
{ "host", >.host, option_str },
|
{ "host", >.host, option_str },
|
||||||
{ "port", >.port, option_long },
|
{ "port", >.port, option_long },
|
||||||
{ "bind", >.bind.list, option_str },
|
{ "bind-port", >.bind_port, option_long },
|
||||||
{ "bind-backup", >.bind.backup, option_str },
|
|
||||||
{ "bind-port", >.bind.port, option_long },
|
|
||||||
{ "dev", >.dev, option_str },
|
{ "dev", >.dev, option_str },
|
||||||
{ "persist", NULL, option_option },
|
{ "persist", NULL, option_option },
|
||||||
{ "mtu", >.mtu, option_long },
|
{ "mtu", >.mtu, option_long },
|
||||||
@@ -284,7 +276,7 @@ main(int argc, char **argv)
|
|||||||
gt_log("couldn't create ICMP socket\n");
|
gt_log("couldn't create ICMP socket\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mud *mud = mud_create(gt.bind.port, gt.ipv4, gt.ipv6);
|
struct mud *mud = mud_create(gt.bind_port, gt.ipv4, gt.ipv6);
|
||||||
|
|
||||||
if (!mud) {
|
if (!mud) {
|
||||||
gt_log("couldn't create mud\n");
|
gt_log("couldn't create mud\n");
|
||||||
@@ -339,37 +331,6 @@ main(int argc, char **argv)
|
|||||||
perror("mud_peer");
|
perror("mud_peer");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gt.bind.backup) {
|
|
||||||
if (mud_add_path(mud, gt.bind.backup, 1)) {
|
|
||||||
perror("mud_add_path (backup)");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gt.bind.list) {
|
|
||||||
char tmp[1024];
|
|
||||||
char *name = &tmp[0];
|
|
||||||
|
|
||||||
str_cpy(tmp, sizeof(tmp) - 1, gt.bind.list);
|
|
||||||
|
|
||||||
while (*name) {
|
|
||||||
char *p = name;
|
|
||||||
|
|
||||||
while (*p && *p != ',')
|
|
||||||
p++;
|
|
||||||
|
|
||||||
if (*p)
|
|
||||||
*p++ = 0;
|
|
||||||
|
|
||||||
if (mud_add_path(mud, name, 0)) {
|
|
||||||
perror("mud_add_path");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
name = p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gt_setup_mtu(mud, tun_name);
|
gt_setup_mtu(mud, tun_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user