From aa0568d912a7e337672c9c822a7b8c402f2bc295 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 17 Jan 2021 02:10:57 +0800 Subject: [PATCH 01/18] luci-app-unblockneteasemusic: move to self-maintained repo Signed-off-by: CN_SZTL --- .../luasrc/controller/unblockneteasemusic.lua | 6 +-- .../luasrc/model/cbi/unblockneteasemusic.lua | 42 +++++++++---------- .../root/etc/config/unblockneteasemusic | 1 + .../usr/share/unblockneteasemusic/update.sh | 8 ++-- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/controller/unblockneteasemusic.lua b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/controller/unblockneteasemusic.lua index 9c1c293b0c..844816ab20 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/controller/unblockneteasemusic.lua +++ b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/controller/unblockneteasemusic.lua @@ -56,8 +56,8 @@ function act_update_luci() end function update_core() - core_cloud_ver=luci.sys.exec("curl -s 'https://github.com/nondanee/UnblockNeteaseMusic/commits/master' |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g'") - core_cloud_ver_mini=luci.sys.exec("curl -s 'https://github.com/nondanee/UnblockNeteaseMusic/commits/master' |tr -d '\n' |grep -Eo 'BtnGroup-item.> [0-9a-z]+' |sed -n 1p |sed 's#BtnGroup-item.> ##g'") + core_cloud_ver=luci.sys.exec("curl -s 'https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced' |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g'") + core_cloud_ver_mini=luci.sys.exec("curl -s 'https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced' |tr -d '\n' |grep -Eo 'BtnGroup-item.> [0-9a-z]+' |sed -n 1p |sed 's#BtnGroup-item.> ##g'") if not core_cloud_ver or not core_cloud_ver_mini then return "1" else @@ -82,4 +82,4 @@ function act_update_core() luci.http.write_json({ ret = update_core(); }) -end \ No newline at end of file +end diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua index c5ffcf65b0..dbc96c3883 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua +++ b/package/ctcgfw/luci-app-unblockneteasemusic/luasrc/model/cbi/unblockneteasemusic.lua @@ -42,6 +42,27 @@ replace_music_source.description = translate("当音乐音质低于指定数值 replace_music_source.default = "dont_replace" replace_music_source.rmempty = false +use_custom_cookie = s:option(Flag, "use_custom_cookie", translate("使用自定义 Cookie")) +use_custom_cookie.description = translate("使用自定义 Cookie 请求音源接口") +use_custom_cookie.default = 0 +use_custom_cookie.rmempty = false + +neteasemusic_cookie = s:option(Value, "neteasemusic_cookie", translate("NeteaseMusic Cookie")) +neteasemusic_cookie.description = translate("在 music.163.com 获取,需要MUSIC_U值") +neteasemusic_cookie.datatype = "string" +neteasemusic_cookie:depends("use_custom_cookie", 1) + +qq_cookie = s:option(Value, "qq_cookie", translate("QQ Cookie")) +qq_cookie.description = translate("在 y.qq.com 获取,需要uin和qm_keyst值") +qq_cookie.placeholder = "uin=; qm_keyst=" +qq_cookie.datatype = "string" +qq_cookie:depends("use_custom_cookie", 1) + +youtube_key = s:option(Value, "youtube_key", translate("Youtube API Key")) +youtube_key.description = translate("API Key申请地址:https://developers.google.com/youtube/v3/getting-started#before-you-start") +youtube_key.datatype = "string" +youtube_key:depends("use_custom_cookie", 1) + use_remote_qq_server = s:option(Flag, "use_remote_qq_server", translate("使用云端QQ音源解析")) use_remote_qq_server.description = translate("通过云端服务器以获取QQ音源信息,无需开通QQ绿钻") use_remote_qq_server.default = 0 @@ -124,27 +145,6 @@ hijack.description = translate("如果使用Hosts劫持,程序监听的HTTP/HT hijack.default = "dont_hijack" hijack:depends("advanced_mode", 1) -use_custom_cookie = s:option(Flag, "use_custom_cookie", translate("使用自定义 Cookie")) -use_custom_cookie.description = translate("使用自定义 Cookie 请求音源接口") -use_custom_cookie.default = 0 -use_custom_cookie:depends("advanced_mode", 1) - -neteasemusic_cookie = s:option(Value, "neteasemusic_cookie", translate("NeteaseMusic Cookie")) -neteasemusic_cookie.description = translate("在 music.163.com 获取,需要MUSIC_U值") -neteasemusic_cookie.datatype = "string" -neteasemusic_cookie:depends("use_custom_cookie", 1) - -qq_cookie = s:option(Value, "qq_cookie", translate("QQ Cookie")) -qq_cookie.description = translate("在 y.qq.com 获取,需要uin和qm_keyst值") -qq_cookie.placeholder = "uin=; qm_keyst=" -qq_cookie.datatype = "string" -qq_cookie:depends("use_custom_cookie", 1) - -youtube_key = s:option(Value, "youtube_key", translate("Youtube API Key")) -youtube_key.description = translate("API Key申请地址:https://developers.google.com/youtube/v3/getting-started#before-you-start") -youtube_key.datatype = "string" -youtube_key:depends("use_custom_cookie", 1) - keep_core_when_upgrade = s:option(Flag, "keep_core_when_upgrade", translate("升级时保留核心程序")) keep_core_when_upgrade.description = translate("默认情况下,在OpenWrt升级后会导致核心程序丢失,开启此选项后会保留当前下载的核心程序") keep_core_when_upgrade.default = 0 diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic index 6f3f5bb65a..d1559b91ec 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/etc/config/unblockneteasemusic @@ -4,6 +4,7 @@ config unblockneteasemusic option music_source 'default' option enable_flac '0' option replace_music_source 'dont_replace' + option use_custom_cookie '0' option use_remote_qq_server '0' option auto_update '1' option update_time '3' diff --git a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh index 1ad10f4aee..fbf62c6d95 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh +++ b/package/ctcgfw/luci-app-unblockneteasemusic/root/usr/share/unblockneteasemusic/update.sh @@ -55,7 +55,7 @@ function update_luci(){ } function check_core_latest_version(){ - core_latest_ver="$(curl -s https://github.com/nondanee/UnblockNeteaseMusic/commits/master |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g')" + core_latest_ver="$(curl -s https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g')" [ -z "${core_latest_ver}" ] && { echo -e "\nFailed to check latest core version, please try again later." >> "/tmp/$NAME.log"; exit 1; } if [ ! -e "/usr/share/$NAME/core_local_ver" ]; then clean_log @@ -80,10 +80,10 @@ function update_core(){ mkdir -p "/usr/share/$NAME/core" > "/dev/null" 2>&1 rm -rf /usr/share/$NAME/core/* > "/dev/null" 2>&1 - curl -sL "https://github.com/nondanee/UnblockNeteaseMusic/archive/master.tar.gz" -o "/usr/share/$NAME/core/core.tar.gz" > "/dev/null" 2>&1 + curl -sL "https://github.com/1715173329/UnblockNeteaseMusic/archive/enhanced.tar.gz" -o "/usr/share/$NAME/core/core.tar.gz" > "/dev/null" 2>&1 tar -zxf "/usr/share/$NAME/core/core.tar.gz" -C "/usr/share/$NAME/core/" > "/dev/null" 2>&1 - mv /usr/share/$NAME/core/UnblockNeteaseMusic-master/* "/usr/share/$NAME/core/" - rm -rf "/usr/share/$NAME/core/core.tar.gz" "/usr/share/$NAME/core/UnblockNeteaseMusic-master" > "/dev/null" 2>&1 + mv /usr/share/$NAME/core/UnblockNeteaseMusic-enhanced/* "/usr/share/$NAME/core/" + rm -rf "/usr/share/$NAME/core/core.tar.gz" "/usr/share/$NAME/core/UnblockNeteaseMusic-enhanced" > "/dev/null" 2>&1 if [ ! -e "/usr/share/$NAME/core/app.js" ]; then echo -e "Failed to download core." >> "/tmp/$NAME.log" From 02ac91f75e5043c1f18c7aa55115e0ec1c419799 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 3 Jan 2021 16:27:08 -0800 Subject: [PATCH 02/18] libusb: update to 1.0.24 Signed-off-by: Rosen Penev --- package/libs/libusb/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 6ce33d3f86..26f7360166 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb -PKG_VERSION:=1.0.22 -PKG_RELEASE:=2 +PKG_VERSION:=1.0.24 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=\ https://github.com/libusb/libusb/releases/download/v$(PKG_VERSION) \ @SF/$(PKG_NAME) -PKG_HASH:=75aeb9d59a4fdb800d329a545c2e6799f732362193b465ea198f2aa275518157 +PKG_HASH:=7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=0 From 2397a49f160d76708a4ff2705ff39e41bddb3847 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 3 Jan 2021 16:27:09 -0800 Subject: [PATCH 03/18] libusb: cleanup PKG_ variables Reordered for consistency between packages. Fixed license information. Change PKG_BUILD_PARALLEL to 1. This is no longer a problem.1 Signed-off-by: Rosen Penev --- package/libs/libusb/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index 26f7360166..d8380ee67d 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -17,11 +17,12 @@ PKG_SOURCE_URL:=\ @SF/$(PKG_NAME) PKG_HASH:=7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=0 -PKG_LICENSE:=LGPL-2.1 +PKG_MAINTAINER:= Felix Fietkau +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING -PKG_MAINTAINER := Felix Fietkau +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk From ddcdb89080d4aad298a420b3e1ebb6e9dabc58d1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 3 Jan 2021 16:27:10 -0800 Subject: [PATCH 04/18] libusb: make InstallDev explicit Helps to see what actually gets installed. Signed-off-by: Rosen Penev --- package/libs/libusb/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile index d8380ee67d..e931536339 100644 --- a/package/libs/libusb/Makefile +++ b/package/libs/libusb/Makefile @@ -46,12 +46,17 @@ CONFIGURE_ARGS += \ --disable-log define Build/InstallDev - $(CP) $(PKG_INSTALL_DIR)/* $(1)/ + $(INSTALL_DIR) $(1)/usr/include/libusb-1.0 + $(CP) $(PKG_INSTALL_DIR)/usr/include/libusb-1.0/libusb.h $(1)/usr/include/libusb-1.0/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libusb-1.0.pc $(1)/usr/lib/pkgconfig/ endef define Package/libusb-1.0/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb*.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libusb-1.0)) From 52285f6cc9670342ba363e2ba338faf1b544de6f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 3 Jan 2021 16:28:43 -0800 Subject: [PATCH 05/18] mbedtls: update to 2.16.9 Signed-off-by: Rosen Penev --- package/libs/mbedtls/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index f7adb90208..4fcef3dd9c 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.16.8 +PKG_VERSION:=2.16.9 PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=fe9e3b15c3375943bdfebbbb20dd6b4f1147b3b5d926248bd835d73247407430 +PKG_HASH:=fc17ff7d8c11d08f23ae2800a18269408ad2c24ea6bb8b9363e41a01c2425697 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0-or-later From f0442438e8a0a888e4761a60f4f82d822be0760f Mon Sep 17 00:00:00 2001 From: taowazi007 Date: Fri, 15 Jan 2021 14:07:27 +0800 Subject: [PATCH 06/18] luci-app-ssr-plus: add support for IPv6 Signed-off-by: CN_SZTL --- package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 1 + 1 file changed, 1 insertion(+) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index cc791479ce..9880a64246 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -232,6 +232,7 @@ gen_service_file() { cat <<-EOF >$2 { "server": "0.0.0.0", + "server_ipv6": "::", "server_port": $(uci_get_by_name $1 server_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), From 7d245fe3d4e0c6ffcc88603faae13711b7179543 Mon Sep 17 00:00:00 2001 From: Mattraks <16359027+Mattraks@users.noreply.github.com> Date: Tue, 19 Jan 2021 22:50:28 +0800 Subject: [PATCH 07/18] luci-app-ssr-plus: bug fixes Signed-off-by: CN_SZTL --- .../lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm | 2 +- package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm b/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm index d9553d15f0..66284ffbab 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm +++ b/package/lean/luci-app-ssr-plus/luasrc/view/shadowsocksr/ssrurl.htm @@ -291,7 +291,7 @@ function import_ssr_url(btn, urlname, sid) { document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = ssm.add; document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm.port; document.getElementsByName('cbid.shadowsocksr.' + sid + '.alter_id')[0].value = ssm.aid; - document.getElementsByName('cbid.shadowsocksr.' + sid + '.uuid')[0].value = ssm.id; + document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = ssm.id; document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = ssm.net; document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event); if (ssm.net == "tcp") { diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 9880a64246..6396d14274 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -617,7 +617,7 @@ load_config() { if [ "$SHUNT_SERVER" == "$GLOBAL_SERVER" ]; then shunt="1" else - shunt="$tmp_shunt_dns_port" + shunt="$tmp_shunt_port" shunt_config_file=$TMP_PATH/shunt-ssr-retcp.json shunt_dns_config_file=$TMP_PATH/shunt-dns-ssr-plus.json start_shunt From 10e725ec6c5dab4a60b90eec6d77d4a900213093 Mon Sep 17 00:00:00 2001 From: taowazi007 Date: Mon, 18 Jan 2021 15:53:45 +0800 Subject: [PATCH 08/18] luci-app-ssrserver-python: add support for IPv6 and chacha20 cipher Signed-off-by: CN_SZTL --- .../lean/luci-app-ssrserver-python/luasrc/model/cbi/ssrs.lua | 1 + package/lean/luci-app-ssrserver-python/root/etc/init.d/ssrs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssrserver-python/luasrc/model/cbi/ssrs.lua b/package/lean/luci-app-ssrserver-python/luasrc/model/cbi/ssrs.lua index 889aca8a68..56e0ca0269 100644 --- a/package/lean/luci-app-ssrserver-python/luasrc/model/cbi/ssrs.lua +++ b/package/lean/luci-app-ssrserver-python/luasrc/model/cbi/ssrs.lua @@ -12,6 +12,7 @@ local n={ "rc4", "rc4-md5", "rc4-md5-6", +"chacha20", } local s={ "origin", diff --git a/package/lean/luci-app-ssrserver-python/root/etc/init.d/ssrs b/package/lean/luci-app-ssrserver-python/root/etc/init.d/ssrs index a6506e3954..1a9148e225 100755 --- a/package/lean/luci-app-ssrserver-python/root/etc/init.d/ssrs +++ b/package/lean/luci-app-ssrserver-python/root/etc/init.d/ssrs @@ -49,9 +49,10 @@ gen_config_file() { cat <<-EOF >$CONFIG_FILE { "server": "0.0.0.0", + "server_ipv6": "::", "server_port": $(uci_get_by_type server server_port), - "local_address":"127.0.0.1", - "local_port":1086, + "local_address":"127.0.0.1", + "local_port":1086, "password": "$(uci_get_by_type server password)", "timeout": $(uci_get_by_type server timeout 60), "method": "$(uci_get_by_type server encrypt_method)", From 3a7d5224cae06eef0a5a36a1b2aaa1815db0487a Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Mon, 18 Jan 2021 15:52:25 +0800 Subject: [PATCH 09/18] kcptun: update to v20210103 Signed-off-by: CN_SZTL --- package/lean/kcptun/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/kcptun/Makefile b/package/lean/kcptun/Makefile index 61df3ba09b..922a95dfd7 100644 --- a/package/lean/kcptun/Makefile +++ b/package/lean/kcptun/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kcptun -PKG_VERSION:=20201126 +PKG_VERSION:=20210103 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/xtaci/kcptun/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=cb4cc62fe6a9f3452f20ada676996b48039f091bdae25943955ac9e2299a9c09 +PKG_HASH:=0821b61b92041b764a1d621f750c1c693d913eed43051d3c109bd303d8f02472 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.md From 9a8c1fa2e2fd858628cb5c6ae86ea38ed0323af5 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 16 Jan 2021 13:48:50 +0100 Subject: [PATCH 10/18] owipcalc: remove clone in cidr_contains6 The "cidr_contains6" functions clones the given cidr. The contains4 does not clone the cidr. Both functions do not behave the same. I see no reason to push the cidr. I think that we get only a negligible performance gain, but it makes ipv4 and ipv6 equal again. Signed-off-by: Nick Hainke --- package/network/utils/owipcalc/Makefile | 2 +- package/network/utils/owipcalc/src/owipcalc.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package/network/utils/owipcalc/Makefile b/package/network/utils/owipcalc/Makefile index 1f4c98bb48..dc68a0346b 100644 --- a/package/network/utils/owipcalc/Makefile +++ b/package/network/utils/owipcalc/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=owipcalc -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=Apache-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/owipcalc/src/owipcalc.c b/package/network/utils/owipcalc/src/owipcalc.c index c4df5c7450..5ed609f158 100644 --- a/package/network/utils/owipcalc/src/owipcalc.c +++ b/package/network/utils/owipcalc/src/owipcalc.c @@ -527,18 +527,17 @@ static bool cidr_network6(struct cidr *a) static bool cidr_contains6(struct cidr *a, struct cidr *b) { - struct cidr *n = cidr_clone(a); - struct in6_addr *x = &n->addr.v6; + struct in6_addr *x = &a->addr.v6; struct in6_addr *y = &b->addr.v6; - uint8_t i = (128 - n->prefix) / 8; - uint8_t m = ~((1 << ((128 - n->prefix) % 8)) - 1); + uint8_t i = (128 - a->prefix) / 8; + uint8_t m = ~((1 << ((128 - a->prefix) % 8)) - 1); uint8_t net1 = x->s6_addr[15-i] & m; uint8_t net2 = y->s6_addr[15-i] & m; if (printed) qprintf(" "); - if ((b->prefix >= n->prefix) && (net1 == net2) && + if ((b->prefix >= a->prefix) && (net1 == net2) && ((i == 15) || !memcmp(&x->s6_addr, &y->s6_addr, 15-i))) { qprintf("1"); From 1e52ee2da7324a408f19b4a6f7d86f775396ab0d Mon Sep 17 00:00:00 2001 From: lean Date: Mon, 18 Jan 2021 12:53:23 +0800 Subject: [PATCH 11/18] Add luci-app-uugamebooster for uuplugin --- package/lean/luci-app-uugamebooster/Makefile | 17 ++++++++++++++ .../luasrc/controller/uuplugin.lua | 15 ++++++++++++ .../luasrc/model/cbi/uuplugin/uuplugin.lua | 15 ++++++++++++ .../luasrc/view/uuplugin/uuplugin_status.htm | 21 +++++++++++++++++ .../po/zh-cn/uuplugin.po | 12 ++++++++++ .../root/etc/config/uuplugin | 4 ++++ .../root/etc/init.d/uuplugin | 23 +++++++++++++++++++ .../root/etc/uci-defaults/45_luci-uuplugin | 11 +++++++++ package/lean/uugamebooster/Makefile | 6 ++--- .../uugamebooster/files/uugamebooster.init | 18 --------------- 10 files changed, 121 insertions(+), 21 deletions(-) create mode 100644 package/lean/luci-app-uugamebooster/Makefile create mode 100644 package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm create mode 100644 package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po create mode 100644 package/lean/luci-app-uugamebooster/root/etc/config/uuplugin create mode 100755 package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin create mode 100644 package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin delete mode 100755 package/lean/uugamebooster/files/uugamebooster.init diff --git a/package/lean/luci-app-uugamebooster/Makefile b/package/lean/luci-app-uugamebooster/Makefile new file mode 100644 index 0000000000..9c93424463 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/Makefile @@ -0,0 +1,17 @@ +# Copyright (C) 2020 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI support for UUgamebooster +LUCI_DEPENDS:=+uugamebooster +LUCI_PKGARCH:=all +PKG_NAME:=luci-app-uugamebooster +PKG_VERSION:=1.0 +PKG_RELEASE:=3 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file diff --git a/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua new file mode 100644 index 0000000000..f67e4cb7e1 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua @@ -0,0 +1,15 @@ +module("luci.controller.uuplugin",package.seeall) + +function index() + if not nixio.fs.access("/etc/config/uuplugin") then return end + + entry({"admin", "services", "uuplugin"}, cbi("uuplugin/uuplugin"), ("UU GameAcc"),99).dependent=true + entry({"admin","services","uuplugin","status"},call("act_status")).leaf=true +end + +function act_status() + local e={} + e.running=luci.sys.call("pgrep -f uuplugin >/dev/null")==0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua new file mode 100644 index 0000000000..071afda670 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua @@ -0,0 +1,15 @@ +require("luci.util") + +mp = Map("uuplugin", translate("UU Game Accelerator")) +mp.description = translate("A Paid Game Acceleration service") +mp:section(SimpleSection).template = "uuplugin/uuplugin_status" + +s = mp:section(TypedSection, "uuplugin") +s.anonymous=true +s.addremove=false + +o = s:option(Flag, "enabled", translate("Enable")) +o.default = 0 +o.optional = false + +return mp diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm new file mode 100644 index 0000000000..c4930636ee --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm @@ -0,0 +1,21 @@ + + +
+

+ <%:Collecting data...%> +

+
diff --git a/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po b/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po new file mode 100644 index 0000000000..855cf3461b --- /dev/null +++ b/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po @@ -0,0 +1,12 @@ + +msgid "Enable" +msgstr "启用" + +msgid "UU GameAcc" +msgstr "UU游戏加速器" + +msgid "UU Game Accelerator" +msgstr "UU游戏加速器" + +msgid "A Paid Game Acceleration service" +msgstr "一个富家子弟用的的游戏加速器" diff --git a/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin new file mode 100644 index 0000000000..3df3127498 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin @@ -0,0 +1,4 @@ + +config uuplugin 'uuplugin' + option enabled '0' + diff --git a/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin new file mode 100755 index 0000000000..6eec9607de --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=10 + +USE_PROCD=1 + +NAME="uugamebooster" +UU_BIN="/usr/share/uugamebooster/uuplugin" +UU_CONF="/usr/share/uugamebooster/uu.conf" +UU_LOGFILE="/tmp/uugamebooster.log" + +start_service() { + config_load uuplugin + local enable + config_get_bool enable uuplugin enabled + if [ "$enable" -eq 1 ]; then + procd_open_instance + procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 + procd_set_param respawn + procd_close_instance + fi +} diff --git a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin new file mode 100644 index 0000000000..e65f87ecec --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@uuplugin[-1] + add ucitrack uuplugin + set ucitrack.@uuplugin[-1].init=uuplugin + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/package/lean/uugamebooster/Makefile b/package/lean/uugamebooster/Makefile index c73446554e..10a075b0bc 100644 --- a/package/lean/uugamebooster/Makefile +++ b/package/lean/uugamebooster/Makefile @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uugamebooster PKG_VERSION:=v2.7.2 -PKG_RELEASE:=2 +PKG_RELEASE:=5 include $(INCLUDE_DIR)/package.mk @@ -70,8 +70,8 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster + # $(INSTALL_DIR) $(1)/etc/init.d + # $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uuplugin $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME) $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin diff --git a/package/lean/uugamebooster/files/uugamebooster.init b/package/lean/uugamebooster/files/uugamebooster.init deleted file mode 100755 index 7fa2ea8acc..0000000000 --- a/package/lean/uugamebooster/files/uugamebooster.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -STOP=10 - -USE_PROCD=1 - -NAME="uugamebooster" -UU_BIN="/usr/share/uugamebooster/uuplugin" -UU_CONF="/usr/share/uugamebooster/uu.conf" -UU_LOGFILE="/tmp/uugamebooster.log" - -start_service() { - procd_open_instance - procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 - procd_set_param respawn - procd_close_instance -} From da8aa70efbdb41ca887972bde63a18a94c44856f Mon Sep 17 00:00:00 2001 From: ZhenYu Date: Tue, 19 Jan 2021 23:42:00 +0800 Subject: [PATCH 12/18] uugamebooster & luci-app-uugamebooster (#6217) * uugamebooster: rebuild startup service * luci-app-uugamebooster: use standerd terms * luci-app-uugamebooster: use inter-startup funcion * luci-app-uugamebooster: fix typo --- package/lean/luci-app-uugamebooster/Makefile | 4 ++-- .../luasrc/controller/uugamebooster.lua | 15 ++++++++++++ .../luasrc/controller/uuplugin.lua | 15 ------------ .../model/cbi/uugamebooster/uugamebooster.lua | 24 +++++++++++++++++++ .../luasrc/model/cbi/uuplugin/uuplugin.lua | 15 ------------ .../uugamebooster/uugamebooster_status.htm | 21 ++++++++++++++++ .../luasrc/view/uuplugin/uuplugin_status.htm | 21 ---------------- .../po/zh-cn/uugamebooster.po | 9 +++++++ .../po/zh-cn/uuplugin.po | 12 ---------- .../root/etc/config/uugamebooster | 4 ++++ .../root/etc/config/uuplugin | 4 ---- .../root/etc/init.d/uuplugin | 23 ------------------ .../etc/uci-defaults/45_luci-uugamebooster | 11 +++++++++ .../root/etc/uci-defaults/45_luci-uuplugin | 11 --------- package/lean/uugamebooster/Makefile | 6 ++--- .../uugamebooster/files/uugamebooster.init | 18 ++++++++++++++ 16 files changed, 107 insertions(+), 106 deletions(-) create mode 100644 package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua create mode 100644 package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm delete mode 100644 package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm create mode 100644 package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po delete mode 100644 package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po create mode 100644 package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster delete mode 100644 package/lean/luci-app-uugamebooster/root/etc/config/uuplugin delete mode 100755 package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin create mode 100644 package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster delete mode 100644 package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin create mode 100755 package/lean/uugamebooster/files/uugamebooster.init diff --git a/package/lean/luci-app-uugamebooster/Makefile b/package/lean/luci-app-uugamebooster/Makefile index 9c93424463..9c407fb4ad 100644 --- a/package/lean/luci-app-uugamebooster/Makefile +++ b/package/lean/luci-app-uugamebooster/Makefile @@ -10,8 +10,8 @@ LUCI_DEPENDS:=+uugamebooster LUCI_PKGARCH:=all PKG_NAME:=luci-app-uugamebooster PKG_VERSION:=1.0 -PKG_RELEASE:=3 +PKG_RELEASE:=5 include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file +# call BuildPackage - OpenWrt buildroot signature diff --git a/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua b/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua new file mode 100644 index 0000000000..830cffd05a --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/controller/uugamebooster.lua @@ -0,0 +1,15 @@ +module("luci.controller.uugamebooster",package.seeall) + +function index() + if not nixio.fs.access("/etc/config/uugamebooster") then return end + + entry({"admin", "services", "uugamebooster"}, cbi("uugamebooster/uugamebooster"), ("UU Game Booster"),99).dependent=true + entry({"admin","services","uugamebooster","status"},call("act_status")).leaf=true +end + +function act_status() + local e={} + e.running=luci.sys.call("pgrep -f uugamebooster >/dev/null")==0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua deleted file mode 100644 index f67e4cb7e1..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/controller/uuplugin.lua +++ /dev/null @@ -1,15 +0,0 @@ -module("luci.controller.uuplugin",package.seeall) - -function index() - if not nixio.fs.access("/etc/config/uuplugin") then return end - - entry({"admin", "services", "uuplugin"}, cbi("uuplugin/uuplugin"), ("UU GameAcc"),99).dependent=true - entry({"admin","services","uuplugin","status"},call("act_status")).leaf=true -end - -function act_status() - local e={} - e.running=luci.sys.call("pgrep -f uuplugin >/dev/null")==0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua new file mode 100644 index 0000000000..07333798bf --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uugamebooster/uugamebooster.lua @@ -0,0 +1,24 @@ +require("luci.util") + +mp = Map("uugamebooster", translate("UU Game Booster")) +mp.description = translate("A Paid Game Acceleration service") +mp:section(SimpleSection).template = "uugamebooster/uugamebooster_status" + +s = mp:section(TypedSection, "uugamebooster") +s.anonymous=true +s.addremove=false + +o = s:option(Flag, "enabled", translate("Enable")) +o.default = 0 +o.optional = false + +function o.write(self, section, value) + if value == "1" then + luci.sys.call("/etc/init.d/uugamebooster start >/dev/null && /etc/init.d/uugamebooster enable >/dev/null") + else + luci.sys.call("/etc/init.d/uugamebooster stop >/dev/null && /etc/init.d/uugamebooster disable >/dev/null") + end + return Flag.write(self, section, value) +end + +return mp diff --git a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua b/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua deleted file mode 100644 index 071afda670..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/model/cbi/uuplugin/uuplugin.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("luci.util") - -mp = Map("uuplugin", translate("UU Game Accelerator")) -mp.description = translate("A Paid Game Acceleration service") -mp:section(SimpleSection).template = "uuplugin/uuplugin_status" - -s = mp:section(TypedSection, "uuplugin") -s.anonymous=true -s.addremove=false - -o = s:option(Flag, "enabled", translate("Enable")) -o.default = 0 -o.optional = false - -return mp diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm new file mode 100644 index 0000000000..2b83098754 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/luasrc/view/uugamebooster/uugamebooster_status.htm @@ -0,0 +1,21 @@ + + +
+

+ <%:Collecting data...%> +

+
diff --git a/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm b/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm deleted file mode 100644 index c4930636ee..0000000000 --- a/package/lean/luci-app-uugamebooster/luasrc/view/uuplugin/uuplugin_status.htm +++ /dev/null @@ -1,21 +0,0 @@ - - -
-

- <%:Collecting data...%> -

-
diff --git a/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po b/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po new file mode 100644 index 0000000000..e91029e72c --- /dev/null +++ b/package/lean/luci-app-uugamebooster/po/zh-cn/uugamebooster.po @@ -0,0 +1,9 @@ + +msgid "Enable" +msgstr "启用" + +msgid "UU Game Booster" +msgstr "网易UU网游加速器" + +msgid "A Paid Game Acceleration service" +msgstr "一个富家子弟用的游戏加速器" diff --git a/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po b/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po deleted file mode 100644 index 855cf3461b..0000000000 --- a/package/lean/luci-app-uugamebooster/po/zh-cn/uuplugin.po +++ /dev/null @@ -1,12 +0,0 @@ - -msgid "Enable" -msgstr "启用" - -msgid "UU GameAcc" -msgstr "UU游戏加速器" - -msgid "UU Game Accelerator" -msgstr "UU游戏加速器" - -msgid "A Paid Game Acceleration service" -msgstr "一个富家子弟用的的游戏加速器" diff --git a/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster b/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster new file mode 100644 index 0000000000..ed8a894041 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/config/uugamebooster @@ -0,0 +1,4 @@ + +config uugamebooster 'uugamebooster' + option enabled '0' + diff --git a/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin deleted file mode 100644 index 3df3127498..0000000000 --- a/package/lean/luci-app-uugamebooster/root/etc/config/uuplugin +++ /dev/null @@ -1,4 +0,0 @@ - -config uuplugin 'uuplugin' - option enabled '0' - diff --git a/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin b/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin deleted file mode 100755 index 6eec9607de..0000000000 --- a/package/lean/luci-app-uugamebooster/root/etc/init.d/uuplugin +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -STOP=10 - -USE_PROCD=1 - -NAME="uugamebooster" -UU_BIN="/usr/share/uugamebooster/uuplugin" -UU_CONF="/usr/share/uugamebooster/uu.conf" -UU_LOGFILE="/tmp/uugamebooster.log" - -start_service() { - config_load uuplugin - local enable - config_get_bool enable uuplugin enabled - if [ "$enable" -eq 1 ]; then - procd_open_instance - procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 - procd_set_param respawn - procd_close_instance - fi -} diff --git a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster new file mode 100644 index 0000000000..4eeb70d8e1 --- /dev/null +++ b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uugamebooster @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@uugamebooster[-1] + add ucitrack uugamebooster + set ucitrack.@uugamebooster[-1].init=uugamebooster + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin b/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin deleted file mode 100644 index e65f87ecec..0000000000 --- a/package/lean/luci-app-uugamebooster/root/etc/uci-defaults/45_luci-uuplugin +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@uuplugin[-1] - add ucitrack uuplugin - set ucitrack.@uuplugin[-1].init=uuplugin - commit ucitrack -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/package/lean/uugamebooster/Makefile b/package/lean/uugamebooster/Makefile index 10a075b0bc..cdf7226bed 100644 --- a/package/lean/uugamebooster/Makefile +++ b/package/lean/uugamebooster/Makefile @@ -13,7 +13,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uugamebooster PKG_VERSION:=v2.7.2 -PKG_RELEASE:=5 +PKG_RELEASE:=6 include $(INCLUDE_DIR)/package.mk @@ -70,8 +70,8 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - # $(INSTALL_DIR) $(1)/etc/init.d - # $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uuplugin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME) $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin diff --git a/package/lean/uugamebooster/files/uugamebooster.init b/package/lean/uugamebooster/files/uugamebooster.init new file mode 100755 index 0000000000..7fa2ea8acc --- /dev/null +++ b/package/lean/uugamebooster/files/uugamebooster.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=10 + +USE_PROCD=1 + +NAME="uugamebooster" +UU_BIN="/usr/share/uugamebooster/uuplugin" +UU_CONF="/usr/share/uugamebooster/uu.conf" +UU_LOGFILE="/tmp/uugamebooster.log" + +start_service() { + procd_open_instance + procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1 + procd_set_param respawn + procd_close_instance +} From 2e4457de4dd12c54a96bb14e0fe71534f36595a7 Mon Sep 17 00:00:00 2001 From: Rogan Dawes Date: Wed, 27 May 2020 10:43:26 +0200 Subject: [PATCH 13/18] sunxi: add text referencing Allwinner H3 and H5 CPUs This makes it a little easier to figure out which options to choose. Signed-off-by: Rogan Dawes Signed-off-by: CN_SZTL --- target/linux/sunxi/Makefile | 2 +- target/linux/sunxi/cortexa53/target.mk | 2 +- target/linux/sunxi/cortexa7/target.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile index e1630fb441..2168b560fa 100644 --- a/target/linux/sunxi/Makefile +++ b/target/linux/sunxi/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=sunxi -BOARDNAME:=Allwinner A1x/A20/A3x/R40 +BOARDNAME:=Allwinner A1x/A20/A3x/H3/H5/R40 FEATURES:=fpu usb ext4 display rtc squashfs SUBTARGETS:=cortexa8 cortexa7 cortexa53 MAINTAINER:=Zoltan HERPAI diff --git a/target/linux/sunxi/cortexa53/target.mk b/target/linux/sunxi/cortexa53/target.mk index 6715d00bda..435d88f5f4 100644 --- a/target/linux/sunxi/cortexa53/target.mk +++ b/target/linux/sunxi/cortexa53/target.mk @@ -8,6 +8,6 @@ include $(TOPDIR)/rules.mk ARCH:=aarch64 -BOARDNAME:=Allwinner A64 +BOARDNAME:=Allwinner A64/H5 CPU_TYPE:=cortex-a53 KERNELNAME:=Image dtbs diff --git a/target/linux/sunxi/cortexa7/target.mk b/target/linux/sunxi/cortexa7/target.mk index b6bdd483bb..238eb17ac1 100644 --- a/target/linux/sunxi/cortexa7/target.mk +++ b/target/linux/sunxi/cortexa7/target.mk @@ -7,6 +7,6 @@ include $(TOPDIR)/rules.mk -BOARDNAME:=Allwinner A20/A3x/R40 +BOARDNAME:=Allwinner A20/A3x/H3/R40 CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 From 83a2987c4722a3b65994a7edb4f10a063392e7fe Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 5 May 2020 13:06:26 +0200 Subject: [PATCH 14/18] sunxi: tidy up cases in base-files This removes unnecessary quotes in cases and applies alphabetic order to members. Signed-off-by: Adrian Schmutzler --- .../linux/sunxi/base-files/etc/board.d/02_network | 14 +++++++------- .../sunxi/base-files/lib/preinit/03_b53_hack.sh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/sunxi/base-files/etc/board.d/02_network b/target/linux/sunxi/base-files/etc/board.d/02_network index 984d5b3be6..5cf000cccf 100755 --- a/target/linux/sunxi/base-files/etc/board.d/02_network +++ b/target/linux/sunxi/base-files/etc/board.d/02_network @@ -7,19 +7,19 @@ board_config_update -case "$(board_name)" in -"olimex,a20-olinuxino-micro") - ucidef_set_interface_lan 'wlan0' - ;; -"lamobo,lamobo-r1") +case $(board_name) in +lamobo,lamobo-r1) ucidef_add_switch "switch0" \ "4:lan:1" "0:lan:2" "1:lan:3" "2:lan:4" "3:wan" "8@eth0" ;; -"xunlong,orangepi-r1") +olimex,a20-olinuxino-micro) + ucidef_set_interface_lan "wlan0" + ;; +xunlong,orangepi-r1) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; *) - ucidef_set_interface_lan 'eth0' + ucidef_set_interface_lan "eth0" ;; esac diff --git a/target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh b/target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh index f24da4dd28..cab36c2848 100755 --- a/target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh +++ b/target/linux/sunxi/base-files/lib/preinit/03_b53_hack.sh @@ -5,7 +5,7 @@ do_b53_hack() { # hack: enable switch on Lamobo R1 and reset counters case $(board_name) in - "lamobo,lamobo-r1") + lamobo,lamobo-r1) ip link set eth0 up sleep 1 swconfig dev switch0 set reset 1 From 60d63904de09e82aad420228492846fa2cc11563 Mon Sep 17 00:00:00 2001 From: zxlhhyccc <45259624+zxlhhyccc@users.noreply.github.com> Date: Thu, 21 Jan 2021 13:15:04 +0800 Subject: [PATCH 15/18] naiveproxy: bump to 88.0.4324.96-1 Signed-off-by: CN_SZTL --- package/ctcgfw/naiveproxy/Makefile | 20 +++++++++---------- ...101-build-drop-useless-deps-simd_asm.patch | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/ctcgfw/naiveproxy/Makefile b/package/ctcgfw/naiveproxy/Makefile index 4dc95824c2..59853b5885 100644 --- a/package/ctcgfw/naiveproxy/Makefile +++ b/package/ctcgfw/naiveproxy/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=naiveproxy -PKG_VERSION:=87.0.4280.66-1 +PKG_VERSION:=88.0.4324.96-1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/klzgrad/naiveproxy/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=17e79172fa32cb3b619614af989569aec7e866046f17e4a1b2179940f1915290 +PKG_HASH:=287c5291d0371a0d1e06f08fcb29c1d80da4a07e557fb8d2bf770b357a8eb29a PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD 3-Clause @@ -62,42 +62,42 @@ ifneq ($(CONFIG_CCACHE),) export naive_ccache_flags=cc_wrapper="ccache" endif -AFDO_VER:=87.0.4278.0_rc-r1-merged +AFDO_VER:=88.0.4324.91_rc-r1-merged AFDO_FILE:=chromeos-chrome-amd64-$$(AFDO_VER).afdo.bz2 define Download/AFDO_PROF URL:=https://storage.googleapis.com.cnpmjs.org/chromeos-prebuilt/afdo-job/llvm \ https://storage.googleapis.com/chromeos-prebuilt/afdo-job/llvm URL_FILE:=$(AFDO_FILE) FILE:=$(AFDO_FILE) - HASH:=7625590b588195918b30c63db20e06339132bbe8975f39e2e429b929682ee3ff + HASH:=d918ae36f535ffd7a3c36c7d06a0a58a3d93f03d07a670cee0f7cb4538925b34 endef -CLANG_VER:=llvmorg-12-init-5035-gd0abc757-3 +CLANG_VER:=llvmorg-12-init-11462-g418f18c6-1 CLANG_FILE:=clang-$$(CLANG_VER).tgz define Download/CLANG URL:=https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64 URL_FILE:=$(CLANG_FILE) FILE:=$(CLANG_FILE) - HASH:=b0c3015209b6d624844ad230064eb5c9b4429a2eafd4854981e73217c563d93d + HASH:=59e4682179bbda9b1cf7fcc5c6e3e24445d6e9e8411bd1c893882f63c6b65308 endef -GN_VER:=e002e68a48d1c82648eadde2f6aafa20d08c36f2 +GN_VER:=53d92014bf94c3893886470a1c7c1289f8818db0 GN_FILE:=gn-git_revision-$(GN_VER).zip define Download/GN_TOOL URL:=https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+ URL_FILE:=git_revision:$(GN_VER) FILE:=$(GN_FILE) - HASH:=67a733dc12803f61a0565ba3a390fa08576b2c4dc1d615c5c15c2b681e900675 + HASH:=e39d3da74cb2802614c0edc4877483ff50045abedb98adb40eaadb68ab4066ff endef -PGO_VER:=4280-1605284980-f890b7d0344c87909c28619fe56e1dd48953d29e +PGO_VER:=4324-1610733451-8576f5ff23113bddfb13d417df9ef2a9be1f740d PGO_FILE:=chrome-linux-$(PGO_VER).profdata define Download/PGO_PROF URL:=https://storage.googleapis.com.cnpmjs.org/chromium-optimization-profiles/pgo_profiles \ https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles URL_FILE:=$(PGO_FILE) FILE:=$(PGO_FILE) - HASH:=8d87e67b84b2694776c931d8eabf0760144420718fe6a5352951fae38a3a25f6 + HASH:=82e03005e7fb7810a2db7eb9a07bde4c19742ac0b4709ef9e734678d155c04fc endef define Build/Prepare diff --git a/package/ctcgfw/naiveproxy/patches/101-build-drop-useless-deps-simd_asm.patch b/package/ctcgfw/naiveproxy/patches/101-build-drop-useless-deps-simd_asm.patch index a87c21ccf2..69b28f193a 100644 --- a/package/ctcgfw/naiveproxy/patches/101-build-drop-useless-deps-simd_asm.patch +++ b/package/ctcgfw/naiveproxy/patches/101-build-drop-useless-deps-simd_asm.patch @@ -17,7 +17,7 @@ So, let's drop it in global build file. --- a/src/BUILD.gn +++ b/src/BUILD.gn -@@ -754,7 +754,6 @@ group("gn_all") { +@@ -758,7 +758,6 @@ group("gn_all") { if (enable_nacl) { deps += [ "//native_client/src/trusted/platform_qualify:vcpuid" ] } From 734782df2831c0028c9a0933e1157a4db95f6622 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 11 Jan 2021 00:33:07 +0100 Subject: [PATCH 16/18] dnsmasq: Update to version 2.83 This fixes the following security problems in dnsmasq: * CVE-2020-25681: Dnsmasq versions before 2.83 is susceptible to a heap-based buffer overflow in sort_rrset() when DNSSEC is used. This can allow a remote attacker to write arbitrary data into target device's memory that can lead to memory corruption and other unexpected behaviors on the target device. * CVE-2020-25682: Dnsmasq versions before 2.83 is susceptible to buffer overflow in extract_name() function due to missing length check, when DNSSEC is enabled. This can allow a remote attacker to cause memory corruption on the target device. * CVE-2020-25683: Dnsmasq version before 2.83 is susceptible to a heap-based buffer overflow when DNSSEC is enabled. A remote attacker, who can create valid DNS replies, could use this flaw to cause an overflow in a heap- allocated memory. This flaw is caused by the lack of length checks in rtc1035.c:extract_name(), which could be abused to make the code execute memcpy() with a negative size in get_rdata() and cause a crash in Dnsmasq, resulting in a Denial of Service. * CVE-2020-25684: A lack of proper address/port check implemented in Dnsmasq version < 2.83 reply_query function makes forging replies easier to an off-path attacker. * CVE-2020-25685: A lack of query resource name (RRNAME) checks implemented in Dnsmasq's versions before 2.83 reply_query function allows remote attackers to spoof DNS traffic that can lead to DNS cache poisoning. * CVE-2020-25686: Multiple DNS query requests for the same resource name (RRNAME) by Dnsmasq versions before 2.83 allows for remote attackers to spoof DNS traffic, using a birthday attack (RFC 5452), that can lead to DNS cache poisoning. * CVE-2020-25687: Dnsmasq versions before 2.83 is vulnerable to a heap-based buffer overflow with large memcpy in sort_rrset() when DNSSEC is enabled. A remote attacker, who can create valid DNS replies, could use this flaw to cause an overflow in a heap-allocated memory. This flaw is caused by the lack of length checks in rtc1035.c:extract_name(), which could be abused to make the code execute memcpy() with a negative size in sort_rrset() and cause a crash in dnsmasq, resulting in a Denial of Service. Signed-off-by: Hauke Mehrtens Signed-off-by: CN_SZTL --- package/network/services/dnsmasq/Makefile | 6 +++--- .../patches/100-remove-old-runtime-kernel-support.patch | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index bab6e4aa6a..fef6e8bb7f 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq -PKG_VERSION:=2.82 -PKG_RELEASE:=7 +PKG_VERSION:=2.83 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq -PKG_HASH:=84523646f3116bb5e1151efb66e645030f6e6a8256f29aab444777a343ebc132 +PKG_HASH:=ffc1f7e8b05e22d910b9a71d09f1128197292766dc7c54cb7018a1b2c3af4aea PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch index aaa5a76909..bd11806ae0 100644 --- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch +++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -1112,7 +1112,7 @@ extern struct daemon { +@@ -1125,7 +1125,7 @@ extern struct daemon { int inotifyfd; #endif #if defined(HAVE_LINUX_NETWORK) @@ -36,7 +36,7 @@ Signed-off-by: Kevin Darbyshire-Bryant #elif defined(HAVE_BSD_NETWORK) int dhcp_raw_fd, dhcp_icmp_fd, routefd; #endif -@@ -1292,9 +1292,6 @@ int read_write(int fd, unsigned char *pa +@@ -1306,9 +1306,6 @@ int read_write(int fd, unsigned char *pa void close_fds(long max_fd, int spare1, int spare2, int spare3); int wildcard_match(const char* wildcard, const char* match); int wildcard_matchn(const char* wildcard, const char* match, int num); From 8bd397327c597ae49c2b3d8749ca5733c6cf2e0f Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 20 Jan 2021 19:09:40 +0800 Subject: [PATCH 17/18] dnsmasq: refresh patches Fix: #260 Signed-off-by: CN_SZTL --- .../dnsmasq/patches/910-mini-ttl.patch | 125 ++++++++---------- .../patches/911-dnsmasq-filter-aaaa.patch | 54 +++----- 2 files changed, 74 insertions(+), 105 deletions(-) diff --git a/package/network/services/dnsmasq/patches/910-mini-ttl.patch b/package/network/services/dnsmasq/patches/910-mini-ttl.patch index 74b5ca11b5..c6171b5018 100644 --- a/package/network/services/dnsmasq/patches/910-mini-ttl.patch +++ b/package/network/services/dnsmasq/patches/910-mini-ttl.patch @@ -1,36 +1,25 @@ -diff --git a/src/dnsmasq.h b/src/dnsmasq.h ---- a/src/dnsmasq.h 2020-03-16 04:31:43.337573724 +0800 -+++ b/src/dnsmasq.h 2020-03-16 04:32:07.138008046 +0800 -@@ -1029,7 +1029,7 @@ +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -1042,7 +1042,7 @@ extern struct daemon { int max_logs; /* queue limit */ int cachesize, ftabsize; int port, query_port, min_port, max_port; - unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl; -+ unsigned long local_ttl, neg_ttl, max_ttl, min_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl; ++ unsigned long local_ttl, neg_ttl, min_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl; char *dns_client_id; struct hostsfile *addn_hosts; struct dhcp_context *dhcp, *dhcp6; -diff --git a/src/option.c b/src/option.c ---- a/src/option.c 2020-03-16 04:33:35.999622026 +0800 -+++ b/src/option.c 2020-03-16 04:40:44.839289942 +0800 -@@ -105,6 +105,7 @@ - #define LOPT_TAG_IF 294 - #define LOPT_PROXY 295 - #define LOPT_GEN_NAMES 296 -+#define LOPT_MINTTL 361 - #define LOPT_MAXTTL 297 - #define LOPT_NO_REBIND 298 - #define LOPT_LOC_REBND 299 -@@ -167,7 +168,7 @@ - #define LOPT_IGNORE_CLID 358 +--- a/src/option.c ++++ b/src/option.c +@@ -168,6 +168,7 @@ struct myoption { #define LOPT_SINGLE_PORT 359 #define LOPT_SCRIPT_TIME 360 -- -+ + #define LOPT_PXE_VENDOR 361 ++#define LOPT_MINTTL 362 + #ifdef HAVE_GETOPT_LONG static const struct option opts[] = - #else -@@ -284,6 +285,7 @@ +@@ -286,6 +287,7 @@ static const struct myoption opts[] = { "dhcp-name-match", 1, 0, LOPT_NAME_MATCH }, { "dhcp-broadcast", 2, 0, LOPT_BROADCAST }, { "neg-ttl", 1, 0, LOPT_NEGTTL }, @@ -38,7 +27,7 @@ diff --git a/src/option.c b/src/option.c { "max-ttl", 1, 0, LOPT_MAXTTL }, { "min-cache-ttl", 1, 0, LOPT_MINCTTL }, { "max-cache-ttl", 1, 0, LOPT_MAXCTTL }, -@@ -410,6 +412,7 @@ +@@ -413,6 +415,7 @@ static struct { { 't', ARG_ONE, "", gettext_noop("Specify default target in an MX record."), NULL }, { 'T', ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for replies from /etc/hosts."), NULL }, { LOPT_NEGTTL, ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for negative caching."), NULL }, @@ -46,7 +35,7 @@ diff --git a/src/option.c b/src/option.c { LOPT_MAXTTL, ARG_ONE, "", gettext_noop("Specify time-to-live in seconds for maximum TTL to send to clients."), NULL }, { LOPT_MAXCTTL, ARG_ONE, "", gettext_noop("Specify time-to-live ceiling for cache."), NULL }, { LOPT_MINCTTL, ARG_ONE, "", gettext_noop("Specify time-to-live floor for cache."), NULL }, -@@ -2812,6 +2815,7 @@ +@@ -2823,6 +2826,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma case 'T': /* --local-ttl */ case LOPT_NEGTTL: /* --neg-ttl */ @@ -54,7 +43,7 @@ diff --git a/src/option.c b/src/option.c case LOPT_MAXTTL: /* --max-ttl */ case LOPT_MINCTTL: /* --min-cache-ttl */ case LOPT_MAXCTTL: /* --max-cache-ttl */ -@@ -2823,6 +2827,8 @@ +@@ -2834,6 +2838,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma ret_err(gen_err); else if (option == LOPT_NEGTTL) daemon->neg_ttl = (unsigned long)ttl; @@ -63,55 +52,51 @@ diff --git a/src/option.c b/src/option.c else if (option == LOPT_MAXTTL) daemon->max_ttl = (unsigned long)ttl; else if (option == LOPT_MINCTTL) -diff --git a/src/rfc1035.c b/src/rfc1035.c ---- a/src/rfc1035.c 2020-03-08 23:56:19.000000000 +0800 -+++ b/src/rfc1035.c 2020-03-16 04:41:50.888215364 +0800 -@@ -664,11 +664,20 @@ - GETSHORT(aqtype, p1); +--- a/src/rfc1035.c ++++ b/src/rfc1035.c +@@ -606,6 +606,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t + for (j = 0; j < ntohs(header->ancount); j++) + { + int secflag = 0; ++ unsigned long mttl = 0; + unsigned char *tmp = namep; + /* the loop body overwrites the original name, so get it back here. */ + if (!extract_name(header, qlen, &tmp, name, 1, 0) || +@@ -616,6 +617,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t GETSHORT(aqclass, p1); GETLONG(attl, p1); -+ unsigned long mttl = 0; if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign) ++ { ++ mttl = daemon->max_ttl; ++ } ++ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) ++ { ++ mttl = daemon->min_ttl; ++ } ++ if (mttl != 0) { -- (p1) -= 4; -- PUTLONG(daemon->max_ttl, p1); -- } -+ mttl = daemon->max_ttl; -+ } -+ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) -+ { -+ mttl = daemon->min_ttl; -+ } -+ if (mttl != 0) -+ { -+ (p1) -= 4; -+ PUTLONG(mttl, p1); -+ } - GETSHORT(ardlen, p1); - endrr = p1+ardlen; - -@@ -760,11 +769,20 @@ - GETSHORT(aqtype, p1); + (p1) -= 4; + PUTLONG(daemon->max_ttl, p1); +@@ -704,6 +713,7 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t + for (j = 0; j < ntohs(header->ancount); j++) + { + int secflag = 0; ++ unsigned long mttl = 0; + + if (!(res = extract_name(header, qlen, &p1, name, 0, 10))) + return 0; /* bad packet */ +@@ -712,6 +722,14 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t GETSHORT(aqclass, p1); GETLONG(attl, p1); -+ unsigned long mttl = 0; if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign) -- { -- (p1) -= 4; -- PUTLONG(daemon->max_ttl, p1); -- } -+ { -+ mttl = daemon->max_ttl; -+ } -+ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) -+ { -+ mttl = daemon->min_ttl; -+ } -+ if (mttl != 0) -+ { -+ (p1) -= 4; -+ PUTLONG(mttl, p1); -+ } - GETSHORT(ardlen, p1); - endrr = p1+ardlen; - ++ { ++ mttl = daemon->max_ttl; ++ } ++ if ((daemon->min_ttl != 0) && (attl < daemon->min_ttl) && !is_sign) ++ { ++ mttl = daemon->min_ttl; ++ } ++ if (mttl != 0) + { + (p1) -= 4; + PUTLONG(daemon->max_ttl, p1); diff --git a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch index 430f1cd0db..0dcb193934 100644 --- a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch +++ b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch @@ -9,33 +9,27 @@ Subject: [PATCH] add filter-aaaa option src/rfc1035.c | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) -diff --git a/src/dnsmasq.h b/src/dnsmasq.h -index 1896a64..e10d6c4 100644 --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -268,7 +268,8 @@ - #define OPT_IGNORE_CLID 59 +@@ -270,6 +270,7 @@ struct event_desc { #define OPT_SINGLE_PORT 60 #define OPT_LEASE_RENEW 61 --#define OPT_LAST 62 -+#define OPT_FILTER_AAAA 62 -+#define OPT_LAST 63 + #define OPT_LAST 62 ++#define OPT_FILTER_AAAA 63 #define OPTION_BITS (sizeof(unsigned int)*8) #define OPTION_SIZE ( (OPT_LAST/OPTION_BITS)+((OPT_LAST%OPTION_BITS)!=0) ) -diff --git a/src/option.c b/src/option.c -index d8c57d6..1cc65bf 100644 --- a/src/option.c +++ b/src/option.c -@@ -168,6 +168,7 @@ - #define LOPT_IGNORE_CLID 358 - #define LOPT_SINGLE_PORT 359 +@@ -169,6 +169,7 @@ struct myoption { #define LOPT_SCRIPT_TIME 360 -+#define LOPT_FILTER_AAAA 362 - + #define LOPT_PXE_VENDOR 361 + #define LOPT_MINTTL 362 ++#define LOPT_FILTER_AAAA 363 + #ifdef HAVE_GETOPT_LONG static const struct option opts[] = -@@ -341,6 +342,7 @@ +@@ -343,6 +344,7 @@ static const struct myoption opts[] = { "dumpfile", 1, 0, LOPT_DUMPFILE }, { "dumpmask", 1, 0, LOPT_DUMPMASK }, { "dhcp-ignore-clid", 0, 0, LOPT_IGNORE_CLID }, @@ -43,32 +37,22 @@ index d8c57d6..1cc65bf 100644 { NULL, 0, 0, 0 } }; -@@ -521,6 +523,7 @@ - { LOPT_DUMPFILE, ARG_ONE, "", gettext_noop("Path to debug packet dump file"), NULL }, - { LOPT_DUMPMASK, ARG_ONE, "", gettext_noop("Mask which packets to dump"), NULL }, - { LOPT_SCRIPT_TIME, OPT_LEASE_RENEW, NULL, gettext_noop("Call dhcp-script when lease expiry changes."), NULL }, -+ { LOPT_FILTER_AAAA, OPT_FILTER_AAAA, NULL, gettext_noop("Filter all AAAA requests."), NULL }, - { 0, 0, NULL, NULL, NULL } - }; - -diff --git a/src/rfc1035.c b/src/rfc1035.c -index 24d08c1..1594962 100644 --- a/src/rfc1035.c +++ b/src/rfc1035.c -@@ -1959,6 +1959,15 @@ +@@ -1926,6 +1926,16 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen, } } -+ //patch to filter aaaa forwards -+ if (qtype == T_AAAA && option_bool(OPT_FILTER_AAAA) ){ -+ //return a null reply -+ ans = 1; -+ if (!dryrun) log_query(F_CONFIG | F_IPV6 | F_NEG, name, &addr, NULL); -+ break; -+ } -+ //end of patch ++ /* patch to filter aaaa forwards */ ++ if (qtype == T_AAAA && option_bool(OPT_FILTER_AAAA)) ++ { ++ /* return a null reply */ ++ ans = 1; ++ if (!dryrun) ++ log_query(F_CONFIG | F_IPV6 | F_NEG, name, &addr, NULL); ++ break; ++ } + if (!ans) return 0; /* failed to answer a question */ } --- From 599e9680fe182c83f6f567764f0fc5a8d7fd0da0 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 20 Jan 2021 19:18:42 +0800 Subject: [PATCH 18/18] dnsmasq: add missing definition Signed-off-by: CN_SZTL --- .../network/services/dnsmasq/patches/910-mini-ttl.patch | 2 +- .../dnsmasq/patches/911-dnsmasq-filter-aaaa.patch | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/patches/910-mini-ttl.patch b/package/network/services/dnsmasq/patches/910-mini-ttl.patch index c6171b5018..f6988f4f5c 100644 --- a/package/network/services/dnsmasq/patches/910-mini-ttl.patch +++ b/package/network/services/dnsmasq/patches/910-mini-ttl.patch @@ -81,7 +81,7 @@ for (j = 0; j < ntohs(header->ancount); j++) { int secflag = 0; -+ unsigned long mttl = 0; ++ unsigned long mttl = 0; if (!(res = extract_name(header, qlen, &p1, name, 0, 10))) return 0; /* bad packet */ diff --git a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch index 0dcb193934..19363c6d35 100644 --- a/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch +++ b/package/network/services/dnsmasq/patches/911-dnsmasq-filter-aaaa.patch @@ -37,6 +37,14 @@ Subject: [PATCH] add filter-aaaa option { NULL, 0, 0, 0 } }; +@@ -524,6 +526,7 @@ static struct { + { LOPT_DUMPFILE, ARG_ONE, "", gettext_noop("Path to debug packet dump file"), NULL }, + { LOPT_DUMPMASK, ARG_ONE, "", gettext_noop("Mask which packets to dump"), NULL }, + { LOPT_SCRIPT_TIME, OPT_LEASE_RENEW, NULL, gettext_noop("Call dhcp-script when lease expiry changes."), NULL }, ++ { LOPT_FILTER_AAAA, OPT_FILTER_AAAA, NULL, gettext_noop("Filter all AAAA requests."), NULL }, + { 0, 0, NULL, NULL, NULL } + }; + --- a/src/rfc1035.c +++ b/src/rfc1035.c @@ -1926,6 +1926,16 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,