X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=e3c543c9d8511ea1c1ece523d52c538be0e8c17f;hb=0c026f3c6dec784c3267ad7e2c4709d5393dc292;hp=8c04d00286abe246bb17892024a99dd51ab50437;hpb=bd451cfe1512fa69eac35a60dbe6df17bfc39154;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 8c04d002..e3c543c9 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -417,7 +417,7 @@ char *get_name(void) { return false; } if(gethostname(hostname, sizeof hostname) || !*hostname) { - logger(DEBUG_ALWAYS, LOG_ERR, "Could not get hostname: %s\n", strerror(errno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Could not get hostname: %s\n", sockstrerror(sockerrno)); return false; } hostname[31] = 0; @@ -728,6 +728,9 @@ static bool add_listen_address(char *address, bool bindto) { } void device_enable(void) { + if (devops.enable) + devops.enable(); + /* Run tinc-up script to further initialize the tap interface */ char *envp[5] = {NULL}; @@ -753,6 +756,9 @@ void device_disable(void) { for(int i = 0; i < 4; i++) free(envp[i]); + + if (devops.disable) + devops.disable(); } /* @@ -974,7 +980,7 @@ static bool setup_myself(void) { for(int i = 0; i < listen_sockets; i++) { 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(errno)); + logger(DEBUG_ALWAYS, LOG_ERR, "Could not get address of listen fd %d: %s", i + 3, sockstrerror(sockerrno)); return false; }