Compare commits

..

1 Commits

Author SHA1 Message Date
angt
a3b78a3868 Update mud 2016-03-30 14:36:52 +00:00
2 changed files with 20 additions and 25 deletions

2
mud

Submodule mud updated: cd9fb7ce34...6b3001e6d8

View File

@@ -242,8 +242,6 @@ int main (int argc, char **argv)
gt.timeout = 5000; gt.timeout = 5000;
long time_tolerance = 0;
struct option opts[] = { struct option opts[] = {
{ "host", &host, option_str }, { "host", &host, option_str },
{ "port", &port, option_str }, { "port", &port, option_str },
@@ -254,7 +252,6 @@ int main (int argc, char **argv)
{ "multiqueue", NULL, option_option }, { "multiqueue", NULL, option_option },
{ "statefile", &statefile, option_str }, { "statefile", &statefile, option_str },
{ "timeout", &gt.timeout, option_long }, { "timeout", &gt.timeout, option_long },
{ "time-tolerance", &time_tolerance, option_long },
{ "version", NULL, option_option }, { "version", NULL, option_option },
{ NULL }, { NULL },
}; };
@@ -282,6 +279,11 @@ int main (int argc, char **argv)
return 1; return 1;
} }
if (!crypto_aead_aes256gcm_is_available()) {
gt_na("AES-256-GCM");
return 1;
}
if (state_init(statefile)) if (state_init(statefile))
return 1; return 1;
@@ -308,11 +310,6 @@ int main (int argc, char **argv)
mud_set_key(mud, gt.key, sizeof(gt.key)); mud_set_key(mud, gt.key, sizeof(gt.key));
mud_set_send_timeout_msec(mud, gt.timeout);
if (time_tolerance > 0)
mud_set_time_tolerance_sec(mud, time_tolerance);
if (bind_list) { if (bind_list) {
char tmp[1024]; char tmp[1024];
char *name = &tmp[0]; char *name = &tmp[0];
@@ -370,15 +367,13 @@ int main (int argc, char **argv)
if (mud_is_up(mud)) { if (mud_is_up(mud)) {
if (!started) { if (!started) {
state("STARTED", tun_name); state("STARTED", NULL);
started = 1; started = 1;
} }
} else { } else if (started) {
if (started) { state("STOPPED", NULL);
state("STOPPED", tun_name);
started = 0; started = 0;
} }
}
if (FD_ISSET(tun_fd, &rfds)) { if (FD_ISSET(tun_fd, &rfds)) {
while (1) { while (1) {