[OpenWrt-Devel] [PATCH relayd] Fix deletion of routing policy rules when terminating due to a signal

Alejandro Enrique alejandro.enrique at fon.com
Wed Feb 11 11:44:38 EST 2015


This patch fix routing policy rules not being deleted on termination
due to SIGTERM, SIGHUP, SIGUSR1 or SIGUSR2.
Calling uloop_end makes the call to uloop_run on main to finish and
the process to exit calling the proper cleaning functions.

Signed-off-by: Alejandro Enrique <alejandro.enrique at fon.com>
---
 main.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 318ba1c..24435b4 100644
--- a/main.c
+++ b/main.c
@@ -670,9 +670,7 @@ static void die(int signo)
 	 * When we hit SIGTERM, clean up interfaces directly, so that we
 	 * won't leave our routing in an invalid state.
 	 */
-	cleanup_hosts();
-	free_interfaces();
-	exit(1);
+	uloop_end();
 }
 
 static int usage(const char *progname)
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list