diff --git a/bbf/Makefile b/bbf/Makefile index d7603ae62..1f8099aae 100644 --- a/bbf/Makefile +++ b/bbf/Makefile @@ -9,7 +9,7 @@ PKG_VERSION:=6.2.6 PKG_FIXUP:=autoreconf PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=947ecd0bea0cf69f2eed11550e8878feea0cdd66 +PKG_SOURCE_VERSION:=d64075bda937114ad4e5e0a5fbc7995afce7b76b PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip diff --git a/icwmp/Makefile b/icwmp/Makefile index c39218342..fe70c5d1c 100755 --- a/icwmp/Makefile +++ b/icwmp/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=8.2.11-2021-11-23 PKG_FIXUP:=autoreconf PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=d485fc0eefbe7c030f0f1278bd50bf8b96868042 +PKG_SOURCE_VERSION:=5401894b4e447aa72d0acf82bd938a04a0330dc5 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip @@ -93,7 +93,7 @@ define Package/$(PKG_NAME)/install $(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd $(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/ $(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/ - $(INSTALL_BIN) ./files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts $(1)/etc/uci-defaults/ + $(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/ $(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp endef diff --git a/icwmp/files/etc/hotplug.d/iface/99-icwmp b/icwmp/files/etc/hotplug.d/iface/99-icwmp index e47508d7f..726dd6f9e 100644 --- a/icwmp/files/etc/hotplug.d/iface/99-icwmp +++ b/icwmp/files/etc/hotplug.d/iface/99-icwmp @@ -98,16 +98,8 @@ handle_icwmp_restart() { done ;; esac - if [ ! -f /var/state/cwmp ]; then - touch /var/state/cwmp - fi - uci -q -c /var/state/ get cwmp.acs - if [ "$?" -ne 0 ]; then - unnamed=`uci -q -c /var/state/ add cwmp acs` - uci -c /var/state/ -q rename cwmp.$unnamed='acs' - fi - [ -n "$url" ] && uci -c /var/state -q set cwmp.acs.dhcp_url="$url" - uci -c /var/state commit cwmp + [ -n "$url" ] && uci -q set cwmp.acs.dhcp_url="$url" + uci commit cwmp } local prevopt43url="" diff --git a/icwmp/files/etc/init.d/icwmpd b/icwmp/files/etc/init.d/icwmpd index e235c45da..8fd431689 100755 --- a/icwmp/files/etc/init.d/icwmpd +++ b/icwmp/files/etc/init.d/icwmpd @@ -51,7 +51,7 @@ wait_for_option43() { log "Waiting for discovery of ACS URL from dhcp server ..." while [ $tm -le $time ] do - acs_url=`uci -c /var/state -q get cwmp.acs.dhcp_url` + acs_url=`uci -q get cwmp.acs.dhcp_url` if [ "$acs_url" != "" ] then break @@ -94,8 +94,8 @@ copy_cwmp_etc_files_to_varstate() { then if [ -f /etc/icwmpd/cwmp ] then - uci -c /etc/icwmpd delete cwmp.acs - uci -c /etc/icwmpd commit cwmp + uci -q -c /etc/icwmpd delete cwmp.acs + uci -q -c /etc/icwmpd commit cwmp cp /etc/icwmpd/cwmp /var/state/cwmp else touch /var/state/cwmp @@ -191,7 +191,7 @@ validate_defaults() { } validate_acs_url() { - dhcp_url=`uci -c /var/state get cwmp.acs.dhcp_url` + dhcp_url=`uci -q get cwmp.acs.dhcp_url` [ -z "${url}" -a -z "${dhcp_url}" ] && { log "ACS url is empty" return 1; @@ -201,7 +201,7 @@ validate_acs_url() { } start_service() { - enable_cwmp=`uci get cwmp.cpe.enable` + enable_cwmp=`uci -q get cwmp.cpe.enable` if [ "$enable_cwmp" = "0" -o "$enable_cwmp" = "false" ]; then log "CWMP is not enabled" return @@ -224,7 +224,7 @@ start_service() { # Set dhcp option 43 if dhcp discovery enabled if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then enable_dhcp_option43 $default_wan_interface - wait_for_option43 20 + wait_for_option43 30 fi validate_acs_url || { diff --git a/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts b/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts deleted file mode 100644 index 460d3280a..000000000 --- a/icwmp/files/etc/uci-defaults/90-icwmp-set-dhcp-reqopts +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -set_cwmp_reqopts() { - ### Ask for DHCP Option 43 only if CWMP is enabled ### - local wan=$(uci -q get cwmp.cpe.default_wan_interface) - local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery) - local discovery=0 - case $dhcp_discovery in - enable|1) discovery=1 ;; - esac - - local newreqopts= - local baseopts= - local reqopts="$(uci -q get network.$wan.reqopts)" - local proto="$(uci -q get network.$wan.proto)" - local tropts="43" - local oldreqopts="$reqopts" - local ropt iopt - for ropt in $reqopts; do - case $ropt in - 43) ;; - *) baseopts="$baseopts $ropt" ;; - esac - done - ropt="" - reqopts="$baseopts $tropts" - for ropt in $reqopts; do - case $ropt in - 43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;; - *) newreqopts="$newreqopts $ropt" ;; - esac - done - if [ "$proto" == "dhcp" ]; then - newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')" - oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')" - [ "$newreqopts" == "$oldreqopts" ] && return - uci -q set network.$wan.reqopts="$newreqopts" - uci commit network - fi -} - -regenerate_ssl_link(){ - local cert_dir="/etc/ssl/certs" - local all_file=$(ls $cert_dir/*.pem) - for cfile in $all_file - do - ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0 - done -} - -set_cwmp_reqopts -regenerate_ssl_link diff --git a/icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl b/icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl new file mode 100644 index 000000000..7bac64850 --- /dev/null +++ b/icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl @@ -0,0 +1,14 @@ +#!/bin/sh + +. /lib/functions.sh + +regenerate_ssl_link(){ + local cert_dir="/etc/ssl/certs" + local all_file=$(ls $cert_dir/*.pem) + for cfile in $all_file + do + ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0 + done +} + +regenerate_ssl_link \ No newline at end of file