From 3656ab9e2a955832f743302a7b7b5a92e35a77d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Mon, 28 Nov 2016 11:02:06 +0000 Subject: [PATCH] Add bind-backup option --- mud | 2 +- src/main.c | 47 ++++++++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/mud b/mud index 72d0573..662fe83 160000 --- a/mud +++ b/mud @@ -1 +1 @@ -Subproject commit 72d0573c95771caf37381f41524f680dfb3d8448 +Subproject commit 662fe8317315307d99be4936f6a5c36b9d87f683 diff --git a/src/main.c b/src/main.c index a121e79..a1acbb7 100644 --- a/src/main.c +++ b/src/main.c @@ -239,6 +239,7 @@ int main (int argc, char **argv) long port = 5000; char *bind_list = NULL; + char *bind_backup = NULL; long bind_port = 5000; char *dev = NULL; @@ -262,6 +263,7 @@ int main (int argc, char **argv) { "host", &host, option_str }, { "port", &port, option_long }, { "bind", &bind_list, option_str }, + { "bind-backup", &bind_backup, option_str }, { "bind-port", &bind_port, option_long }, { "dev", &dev, option_str }, { "mtu", &mtu, option_long }, @@ -357,26 +359,37 @@ int main (int argc, char **argv) if (time_tolerance > 0) mud_set_time_tolerance_sec(mud, time_tolerance); - if (host && port && bind_list) { - char tmp[1024]; - char *name = &tmp[0]; - - size_t size = str_cpy(tmp, bind_list, sizeof(tmp)-1); - - for (size_t i=0; i