From e0b48f133d7c4f5e4b8f62875121a9380a5c9fc5 Mon Sep 17 00:00:00 2001 From: ygg Date: Tue, 4 Aug 2020 13:37:01 +0800 Subject: [PATCH] On Windows, the Edge node exits when the network card is disabled and opened again --- src/edge.c | 4 ++-- win32/wintap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/edge.c b/src/edge.c index fd56e6e..5681df8 100644 --- a/src/edge.c +++ b/src/edge.c @@ -887,9 +887,9 @@ int main(int argc, char* argv[]) { traceEvent(TRACE_WARNING, "Community and encryption key must differ, otherwise security will be compromised"); if(tuntap_open(&tuntap, ec.tuntap_dev_name, ec.ip_mode, ec.ip_addr, ec.netmask, ec.device_mac, ec.mtu) < 0) - return(-1); + exit(1); - if((eee = edge_init(&tuntap, &conf, &rc)) == NULL) { + if((eee = edge_init(&tuntap, &conf, &rc)) == NULL) { traceEvent(TRACE_ERROR, "Failed in edge_init"); exit(1); } diff --git a/win32/wintap.c b/win32/wintap.c index 90606c6..48a10cf 100644 --- a/win32/wintap.c +++ b/win32/wintap.c @@ -241,7 +241,7 @@ int open_wintap(struct tuntap_dev *device, printf("No Windows tap devices found, did you run tapinstall.exe?\n"); else printf("Cannot find tap device \"%s\"\n", devname); - exit(EXIT_FAILURE); + return -1; } /* ************************************** */