projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1
[tinc]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
f63059f
..
c181df9
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-292,7
+292,6
@@
void load_all_subnets(void) {
config_t *cfg;
subnet_t *s, *s2;
node_t *n;
config_t *cfg;
subnet_t *s, *s2;
node_t *n;
- bool result;
xasprintf(&dname, "%s/hosts", confbase);
dir = opendir(dname);
xasprintf(&dname, "%s/hosts", confbase);
dir = opendir(dname);
@@
-314,10
+313,9
@@
void load_all_subnets(void) {
xasprintf(&fname, "%s/hosts/%s", confbase, ent->d_name);
init_configuration(&config_tree);
xasprintf(&fname, "%s/hosts/%s", confbase, ent->d_name);
init_configuration(&config_tree);
- result = read_config_file(config_tree, fname);
+ read_config_options(config_tree, ent->d_name);
+ read_config_file(config_tree, fname);
free(fname);
free(fname);
- if(!result)
- continue;
if(!n) {
n = new_node();
if(!n) {
n = new_node();
@@
-598,6
+596,8
@@
static bool setup_myself(void) {
devops = dummy_devops;
else if(!strcasecmp(type, "raw_socket"))
devops = raw_socket_devops;
devops = dummy_devops;
else if(!strcasecmp(type, "raw_socket"))
devops = raw_socket_devops;
+ else if(!strcasecmp(type, "multicast"))
+ devops = multicast_devops;
#ifdef ENABLE_UML
else if(!strcasecmp(type, "uml"))
devops = uml_devops;
#ifdef ENABLE_UML
else if(!strcasecmp(type, "uml"))
devops = uml_devops;
@@
-647,12
+647,25
@@
static bool setup_myself(void) {
if(cfg)
cfg = lookup_config_next(config_tree, cfg);
if(cfg)
cfg = lookup_config_next(config_tree, cfg);
+ char *port = myport;
+
+ if(address) {
+ char *space = strchr(address, ' ');
+ if(space) {
+ *space++ = 0;
+ port = space;
+ }
+
+ if(!strcmp(address, "*"))
+ *address = 0;
+ }
+
hint.ai_family = addressfamily;
hint.ai_socktype = SOCK_STREAM;
hint.ai_protocol = IPPROTO_TCP;
hint.ai_flags = AI_PASSIVE;
hint.ai_family = addressfamily;
hint.ai_socktype = SOCK_STREAM;
hint.ai_protocol = IPPROTO_TCP;
hint.ai_flags = AI_PASSIVE;
- err = getaddrinfo(address
, my
port, &hint, &ai);
+ err = getaddrinfo(address
&& *address ? address : NULL,
port, &hint, &ai);
free(address);
if(err || !ai) {
free(address);
if(err || !ai) {