ssdpd: 1.0.4

This commit is contained in:
Amin Ben Romdhane 2022-12-21 22:08:51 +01:00
parent 0dae8c3786
commit 52c338366b
3 changed files with 20 additions and 19 deletions

View file

@ -5,3 +5,5 @@ config ssdpd 'ssdp'
option socket_path '/var/run/minissdpd.sock'
option ttl '2'
option interface 'br-lan'
option debug '0'

View file

@ -7,14 +7,14 @@ USE_PROCD=1
PROG=/usr/sbin/ssdpd
log() {
echo "${@}"|logger -t ssdp.init -p info
echo "${@}"|logger -t ssdpd.init -p info
}
validate_ssdpd_ssdp_section()
{
uci_validate_section ssdpd ssdpd "ssdp" \
'enabled:bool:true' \
'debug:bool:0' \
'debug:bool:false' \
'ipv6_enabled:bool:false' \
'socket_path:string' \
'ttl:uinteger' \
@ -35,16 +35,13 @@ configure_ssdp()
[ ${enabled} -eq 0 ] && return 0
procd_set_param command ${PROG}
if [ ${ipv6_enabled} -eq 1 ]; then
procd_append_param command -6
fi
if [ ${debug} -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
else
procd_set_param stdout 0
procd_set_param stderr 0
procd_append_param command -d
fi
if [ -n "${socket_path}" ]; then
@ -57,7 +54,6 @@ configure_ssdp()
# If no interface is given defaults for br-lan
procd_append_param command -i ${interface:-br-lan}
procd_append_param command -d
}
start_service() {

View file

@ -14,8 +14,8 @@
#endif
+extern char *ssdp_sockpath;
+extern void ssdpd_ubus_stop(void);
+void upnp_thread_discover_devices(void);
+void ssdpd_ubus_stop(void);
+
/* current request management structure */
struct reqelem {
@ -72,16 +72,7 @@
}
--- 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:
@@ -624,3 +624,8 @@ end:
uloop_done();
ubus_free(ctx);
}
@ -90,3 +81,15 @@
+{
+ uloop_end();
+}
+
--- a/minissdpd/config.h
+++ b/minissdpd/config.h
@@ -32,7 +32,7 @@
/* When NO_BACKGROUND_NO_PIDFILE is defined, minissdpd does not go to
* background and does not create any pidfile */
-/*#define NO_BACKGROUND_NO_PIDFILE*/
+#define NO_BACKGROUND_NO_PIDFILE
/* define HAVE_IP_MREQN to use struct ip_mreqn instead of struct ip_mreq
* for setsockopt(IP_MULTICAST_IF). Available with Linux 2.4+,