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;
}
void device_enable(void) {
+ if (devops.enable)
+ devops.enable();
+
/* Run tinc-up script to further initialize the tap interface */
char *envp[5] = {NULL};
for(int i = 0; i < 4; i++)
free(envp[i]);
+
+ if (devops.disable)
+ devops.disable();
}
/*
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;
}