Add bind-port option

This commit is contained in:
angt
2016-03-01 15:11:16 +00:00
parent 1dd760e382
commit 664160e0cc
2 changed files with 6 additions and 2 deletions

2
mud

Submodule mud updated: a1ce4740b4...fc8e97caef

View File

@@ -235,6 +235,7 @@ int main (int argc, char **argv)
char *host = NULL; char *host = NULL;
char *port = "5000"; char *port = "5000";
char *bind_list = NULL; char *bind_list = NULL;
char *bind_port = "5000";
char *dev = NULL; char *dev = NULL;
char *keyfile = NULL; char *keyfile = NULL;
char *statefile = NULL; char *statefile = NULL;
@@ -245,6 +246,7 @@ int main (int argc, char **argv)
{ "host", &host, option_str }, { "host", &host, option_str },
{ "port", &port, option_str }, { "port", &port, option_str },
{ "bind", &bind_list, option_str }, { "bind", &bind_list, option_str },
{ "bind-port", &bind_port, option_str },
{ "dev", &dev, option_str }, { "dev", &dev, option_str },
{ "keyfile", &keyfile, option_str }, { "keyfile", &keyfile, option_str },
{ "multiqueue", NULL, option_option }, { "multiqueue", NULL, option_option },
@@ -299,13 +301,15 @@ int main (int argc, char **argv)
if (gt_setup_secretkey(keyfile)) if (gt_setup_secretkey(keyfile))
return 1; return 1;
struct mud *mud = mud_create(gt.key, sizeof(gt.key)); struct mud *mud = mud_create(bind_port);
if (!mud) { if (!mud) {
gt_log("couldn't create mud\n"); gt_log("couldn't create mud\n");
return 1; return 1;
} }
mud_set_key(mud, gt.key, sizeof(gt.key));
if (bind_list) { if (bind_list) {
char tmp[1024]; char tmp[1024];
char *name = &tmp[0]; char *name = &tmp[0];