https-dns-proxy: update to 2021-05-14-1; bugfixes for dhcp server backup 15717/head
authorStan Grishin <stangri@melmac.net>
Sat, 29 May 2021 20:12:27 +0000 (20:12 +0000)
committerStan Grishin <stangri@melmac.net>
Sat, 29 May 2021 20:12:27 +0000 (20:12 +0000)
Signed-off-by: Stan Grishin <stangri@melmac.net>
net/https-dns-proxy/Makefile
net/https-dns-proxy/files/https-dns-proxy.init
net/https-dns-proxy/patches/010-ninja.patch

index 990c4958825c38c5783d6484789b5644db89aad0..887c13a0184d45405c057037a3f63be44e2a153d 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=https-dns-proxy
-PKG_VERSION:=2021-01-17
-PKG_RELEASE:=5
+PKG_VERSION:=2021-05-14
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy
-PKG_SOURCE_DATE:=2021-01-17
-PKG_SOURCE_VERSION:=37511cc08712d7548978a4f6f1cc457b7594fb96
-PKG_MIRROR_HASH:=4e6a7dcb69e350d1df9f17570439b589e031e249da7f91f2ec7600a955e0aaa3
+PKG_SOURCE_DATE:=2021-05-14
+PKG_SOURCE_VERSION:=fa05dcfc46ff6d58999aab1e35bcf1b36b1eb19e
+PKG_MIRROR_HASH:=4fd40c4e64010c5c49629a4de830ab6e53c649458f0adeda5399b350cbe7f319
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
index e83fafb49f434bcfd183822d84bbe7e62c943e4d..8b868076364c86139165c88a3456e1eb259f3056 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh /etc/rc.common
 # Copyright 2019-2020 Stan Grishin (stangri@melmac.net)
-# shellcheck disable=SC2039
+# shellcheck disable=SC2039,SC3043,SC3060
 PKG_VERSION='dev-test'
 
 # shellcheck disable=SC2034
@@ -171,7 +171,7 @@ dnsmasq_add_doh_server() {
 dnsmasq_create_server_backup() {
        local cfg="$1"
        local i
-       uci -q get "dhcp.${cfg}" >/dev/null || return 0
+       uci -q get "dhcp.${cfg}" >/dev/null || return 1
        if ! uci -q get "dhcp.${cfg}.doh_backup_noresolv" >/dev/null; then
                if [ -z "$(uci -q get "dhcp.${cfg}.noresolv")" ]; then
                        uci -q set "dhcp.${cfg}.noresolv=1"
@@ -182,13 +182,17 @@ dnsmasq_create_server_backup() {
                fi
        fi
        if ! uci -q get "dhcp.${cfg}.doh_backup_server" >/dev/null; then
+               if [ -z "$(uci -q get "dhcp.${cfg}.server")" ]; then
+                       uci -q add_list "dhcp.${cfg}.doh_backup_server="
+               fi
                for i in $(uci -q get "dhcp.${cfg}.server"); do
                        uci -q add_list "dhcp.${cfg}.doh_backup_server=$i"
-                       if [ "$i" = "${i//127.0.0.1}" ] && [ "$i" = "$(echo "$i" | tr -d /)" ]; then
+                       if [ "$i" = "$(echo "$i" | tr -d /\#)" ]; then
                                uci -q del_list "dhcp.${cfg}.server=$i"
                        fi
                done
        fi
+       return 0
 }
 
 dnsmasq_restore_server_backup() {
@@ -221,7 +225,8 @@ dhcp_backup() {
                                config_foreach dnsmasq_create_server_backup 'dnsmasq'
                        elif [ -n "$dnsmasqConfig" ]; then
                                for i in $dnsmasqConfig; do
-                                       dnsmasq_create_server_backup "@dnsmasq[${i}]"
+                                       dnsmasq_create_server_backup "@dnsmasq[${i}]" || \
+                                               dnsmasq_create_server_backup "$i"
                                done
                        fi
                        ;;
index 2f29bdbd600f81803c77eb078266b45267485313..ffe108350bf707d940c2b06493c17d7c4d8d5155 100644 (file)
@@ -1,17 +1,7 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -5,7 +5,6 @@ set(CMAKE_BUILD_TYPE "Debug")
- #set(CMAKE_BUILD_TYPE "Release")
- #set(CMAKE_C_FLAGS "-Wall -Wextra --pedantic -Wno-strict-aliasing")
--set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(notdir $<)\"'")
- set(CMAKE_C_FLAGS_DEBUG "-g")
- set(CMAKE_C_FLAGS_RELEASE "-O2")
 --- a/src/logging.h
 +++ b/src/logging.h
-@@ -34,6 +34,20 @@ enum _LogSeverity {
-   LOG_FATAL = 4,
+@@ -36,6 +36,20 @@ enum _LogSeverity {
+   LOG_MAX
  };
  
 +#define STRIPPATH(s)\
@@ -28,6 +18,6 @@
 +
 +#define __FILENAME__ STRIPPATH(__FILE__)
 +
- // Debug, Info, Warning, Error logging.
  #define DLOG(...) _log(__FILENAME__, __LINE__, LOG_DEBUG, __VA_ARGS__)
  #define ILOG(...) _log(__FILENAME__, __LINE__, LOG_INFO, __VA_ARGS__)
+ #define WLOG(...) _log(__FILENAME__, __LINE__, LOG_WARNING, __VA_ARGS__)