From d222a173f826c6bc4b32c3db8bac7ba610632c8e Mon Sep 17 00:00:00 2001
From: dimitri staessens <dimitri.staessens@intec.ugent.be>
Date: Thu, 16 Jun 2016 19:45:55 +0200
Subject: ipcpd: fixed missing unlock in shim UDP

Unlock missing when compiled without DNS support.
---
 src/ipcpd/shim-udp/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c
index 186f0ebc..ccd8530b 100644
--- a/src/ipcpd/shim-udp/main.c
+++ b/src/ipcpd/shim-udp/main.c
@@ -1151,6 +1151,8 @@ static int ipcp_udp_name_reg(char * name)
                         return -1;
                 }
         }
+#else
+        rw_lock_unlock(&_ipcp->state_lock);
 #endif
         LOG_DBG("Registered %s.", name);
 
@@ -1606,7 +1608,9 @@ int main (int argc, char * argv[])
         free(_ipcp->ops);
         free(_ipcp);
 
-        exit(0);
+        LOG_DBG("IPCP exited.");
+
+        exit(EXIT_SUCCESS);
 }
 
 #endif /* MAKE_CHECK */
-- 
cgit v1.2.3


From 0bdec7d84cccf3714804a6bc220fbedf96eccd54 Mon Sep 17 00:00:00 2001
From: dimitri staessens <dimitri.staessens@intec.ugent.be>
Date: Thu, 16 Jun 2016 22:32:06 +0200
Subject: tools: fixed application shutdown

Tools would do a double ap_fini when an error occurred.
---
 src/tools/cbr/cbr_client.c   | 2 --
 src/tools/echo/echo_client.c | 4 ----
 2 files changed, 6 deletions(-)

(limited to 'src')

diff --git a/src/tools/cbr/cbr_client.c b/src/tools/cbr/cbr_client.c
index 1cc325b8..af766599 100644
--- a/src/tools/cbr/cbr_client.c
+++ b/src/tools/cbr/cbr_client.c
@@ -60,7 +60,6 @@ int client_main(char * server,
         fd = flow_alloc(server, NULL, NULL);
         if (fd < 0) {
                 printf("Failed to allocate flow.\n");
-                ap_fini();
                 return -1;
         }
 
@@ -68,7 +67,6 @@ int client_main(char * server,
         if (result < 0) {
                 printf("Flow allocation refused.\n");
                 flow_dealloc(fd);
-                ap_fini();
                 return -1;
         }
 
diff --git a/src/tools/echo/echo_client.c b/src/tools/echo/echo_client.c
index 499e36ee..f006273c 100644
--- a/src/tools/echo/echo_client.c
+++ b/src/tools/echo/echo_client.c
@@ -34,7 +34,6 @@ int client_main()
         fd = flow_alloc("echo", NULL, NULL);
         if (fd < 0) {
                 printf("Failed to allocate flow.\n");
-                ap_fini();
                 return -1;
         }
 
@@ -42,14 +41,12 @@ int client_main()
         if (result < 0) {
                 printf("Flow allocation refused.\n");
                 flow_dealloc(fd);
-                ap_fini();
                 return -1;
         }
 
         if (flow_write(fd, message, strlen(message) + 1) == -1) {
                 printf("Failed to write SDU.\n");
                 flow_dealloc(fd);
-                ap_fini();
                 return -1;
         }
 
@@ -57,7 +54,6 @@ int client_main()
         if (count < 0) {
                 printf("Failed to read SDU.\n");
                 flow_dealloc(fd);
-                ap_fini();
                 return -1;
         }
 
-- 
cgit v1.2.3