mirror of https://github.com/schoebel/mars
net: make port number configurable
This commit is contained in:
parent
261fc98d4a
commit
08a19dae8f
8
Kconfig
8
Kconfig
|
@ -24,6 +24,14 @@ config MARS_BIGMODULE
|
||||||
---help---
|
---help---
|
||||||
Normally ON. Switch off only for EXPERIMENTS!
|
Normally ON. Switch off only for EXPERIMENTS!
|
||||||
|
|
||||||
|
config MARS_DEFAULT_PORT
|
||||||
|
int "port number where MARS is listening"
|
||||||
|
depends on MARS
|
||||||
|
default 7777
|
||||||
|
---help---
|
||||||
|
Best practice is to uniformly use the same port number
|
||||||
|
in a cluster. Therefore, this is compiletime constant.
|
||||||
|
|
||||||
config MARS_MEM_RETRY
|
config MARS_MEM_RETRY
|
||||||
bool "make MARS memory allocation more robust"
|
bool "make MARS memory allocation more robust"
|
||||||
depends on MARS
|
depends on MARS
|
||||||
|
|
|
@ -55,7 +55,7 @@ int mars_create_sockaddr(struct sockaddr_storage *addr, const char *spec)
|
||||||
|
|
||||||
memset(addr, 0, sizeof(*addr));
|
memset(addr, 0, sizeof(*addr));
|
||||||
sockaddr->sin_family = AF_INET;
|
sockaddr->sin_family = AF_INET;
|
||||||
sockaddr->sin_port = htons(MARS_DEFAULT_PORT);
|
sockaddr->sin_port = htons(CONFIG_MARS_DEFAULT_PORT);
|
||||||
|
|
||||||
/* Try to translate hostnames to IPs if possible.
|
/* Try to translate hostnames to IPs if possible.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
|
|
||||||
#include "brick.h"
|
#include "brick.h"
|
||||||
|
|
||||||
#define MARS_DEFAULT_PORT 7777
|
|
||||||
|
|
||||||
extern bool mars_net_is_alive;
|
extern bool mars_net_is_alive;
|
||||||
|
|
||||||
/* The original struct socket has no refcount. This leads to problems
|
/* The original struct socket has no refcount. This leads to problems
|
||||||
|
|
Loading…
Reference in New Issue