From fae6a213ac02f1b821d7dd6bd28fbd3b728283ee Mon Sep 17 00:00:00 2001 From: vdutta Date: Wed, 21 Dec 2022 22:10:49 +0530 Subject: [PATCH] ssdpd: 1.0.2 --- ssdpd/Makefile | 2 +- ssdpd/patches/012-ubus-runner-thread-hook | 34 +++++++++++++++++++---- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ssdpd/Makefile b/ssdpd/Makefile index 187db763c..f7854acd0 100644 --- a/ssdpd/Makefile +++ b/ssdpd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ssdpd -PKG_VERSION:=1.0.1 +PKG_VERSION:=1.0.2 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) diff --git a/ssdpd/patches/012-ubus-runner-thread-hook b/ssdpd/patches/012-ubus-runner-thread-hook index ec66d0487..445f94e92 100644 --- a/ssdpd/patches/012-ubus-runner-thread-hook +++ b/ssdpd/patches/012-ubus-runner-thread-hook @@ -9,17 +9,18 @@ /* LOG_PERROR does not exist on Solaris */ #ifndef LOG_PERROR -@@ -52,6 +54,9 @@ +@@ -52,6 +54,10 @@ #define MIN(x,y) (((x)<(y))?(x):(y)) #endif +extern char *ssdp_sockpath; ++extern void ssdpd_ubus_stop(void); +void upnp_thread_discover_devices(void); + /* current request management structure */ struct reqelem { int socket; -@@ -1220,6 +1225,12 @@ static void ssdpDiscover(int s, int ipv6 +@@ -1220,6 +1226,12 @@ static void ssdpDiscover(int s, int ipv6 } } @@ -32,7 +33,7 @@ /* main(): program entry point */ int main(int argc, char * * argv) { -@@ -1264,6 +1275,7 @@ int main(int argc, char * * argv) +@@ -1264,6 +1276,7 @@ int main(int argc, char * * argv) unsigned char ttl = 2; /* UDA says it should default to 2 */ const char * searched_device = NULL; /* if not NULL, search/filter a specific device type */ int opt; @@ -40,7 +41,7 @@ LIST_INIT(&reqlisthead); LIST_INIT(&servicelisthead); -@@ -1309,6 +1321,7 @@ int main(int argc, char * * argv) +@@ -1309,6 +1322,7 @@ int main(int argc, char * * argv) break; case 's': sockpath = optarg; @@ -48,7 +49,7 @@ break; #ifndef NO_BACKGROUND_NO_PIDFILE case 'p': -@@ -1496,6 +1509,11 @@ int main(int argc, char * * argv) +@@ -1496,6 +1510,11 @@ int main(int argc, char * * argv) if(s_ssdp6 >= 0) ssdpDiscover(s_ssdp6, 1, searched_device); @@ -60,11 +61,32 @@ /* Main loop */ while(!quitting) { /* fill readfds fd_set */ -@@ -1704,6 +1722,7 @@ quit: +@@ -1704,6 +1723,8 @@ quit: if(unlink(pidfilename) < 0) syslog(LOG_ERR, "unlink(%s): %m", pidfilename); #endif ++ ssdpd_ubus_stop(); + pthread_join(upnp_thread, NULL); closelog(); return ret; } +--- a/minissdpd/ssdpd.c ++++ b/minissdpd/ssdpd.c +@@ -28,6 +28,8 @@ + + #include "codelength.h" + ++void ssdpd_ubus_stop(void); ++ + struct UPNPDev { + struct list_head list; + char *descURL; +@@ -624,3 +626,8 @@ end: + uloop_done(); + ubus_free(ctx); + } ++ ++void ssdpd_ubus_stop(void) ++{ ++ uloop_end(); ++}