X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet_setup.c;h=85553be4732b12f8ea6e6cc3e77f06d0bfd57b14;hb=3a316823b971396a428f020f401b9fe41252d98d;hp=6becfbb405ac29c400c92247bd281a7e41cc6c33;hpb=5cbef906209eb5005f821af8f55a6f5d7e7d060c;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 6becfbb4..85553be4 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -236,7 +236,7 @@ static bool read_invitation_key(void) { invitation_key = NULL; } - snprintf(fname, sizeof fname, "%s" SLASH "invitations" SLASH "ed25519_key.priv", confbase); + snprintf(fname, sizeof(fname), "%s" SLASH "invitations" SLASH "ed25519_key.priv", confbase); fp = fopen(fname, "r"); @@ -328,7 +328,7 @@ void load_all_nodes(void) { struct dirent *ent; char dname[PATH_MAX]; - snprintf(dname, sizeof dname, "%s" SLASH "hosts", confbase); + snprintf(dname, sizeof(dname), "%s" SLASH "hosts", confbase); dir = opendir(dname); if(!dir) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno)); @@ -611,6 +611,9 @@ bool setup_myself_reloadable(void) { get_config_bool(lookup_config(config_tree, "DisableBuggyPeers"), &disablebuggypeers); + if(!get_config_int(lookup_config(config_tree, "InvitationExpire"), &invitation_lifetime)) + invitation_lifetime = 604800; // 1 week + read_invitation_key(); return true; @@ -954,7 +957,7 @@ static bool setup_myself(void) { } for(int i = 0; i < listen_sockets; i++) { - salen = sizeof sa; + salen = sizeof(sa); if(getsockname(i + 3, &sa.sa, &salen) < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not get address of listen fd %d: %s", i + 3, sockstrerror(sockerrno)); return false; @@ -1011,7 +1014,7 @@ static bool setup_myself(void) { if(!port_specified || atoi(myport) == 0) { sockaddr_t sa; - socklen_t salen = sizeof sa; + socklen_t salen = sizeof(sa); if(!getsockname(listen_socket[0].udp.fd, &sa.sa, &salen)) { free(myport); sockaddr2str(&sa, NULL, &myport);