Merge Lean's source
This commit is contained in:
commit
73e90d62cc
@ -41,3 +41,8 @@ define FeedSourcesAppend
|
||||
echo '$(if $(filter m,$(CONFIG_FEED_$(feed))),# )src/gz %d_$(feed) %U/packages/%A/$(feed)';)))) \
|
||||
) >> $(1)
|
||||
endef
|
||||
|
||||
# 1: package name
|
||||
define GetABISuffix
|
||||
$(if $(filter-out kmod-%,$(1)),$(if $(Package/$(1)/abiversion),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(Package/$(1)/abiversion)))
|
||||
endef
|
||||
|
||||
@ -13,6 +13,9 @@ endif
|
||||
IPKG_BUILD:= \
|
||||
$(SCRIPT_DIR)/ipkg-build -c -o 0 -g 0
|
||||
|
||||
IPKG_REMOVE:= \
|
||||
$(SCRIPT_DIR)/ipkg-remove
|
||||
|
||||
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg
|
||||
|
||||
# 1: package name
|
||||
@ -90,8 +93,9 @@ _endef=endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
define BuildTarget/ipkg
|
||||
ABIV_$(1):=$(call GetABISuffix,$(1))
|
||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)_$(VERSION)_$(PKGARCH).ipk
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
@ -148,19 +152,20 @@ ifeq ($(DUMP),)
|
||||
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
|
||||
touch $$@
|
||||
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(filter-out @%,$$(IDEPEND_$(1))))
|
||||
Package/$(1)/DEPENDS := $$(call mergelist,$$(foreach dep,$$(filter-out @%,$$(IDEPEND_$(1))),$$(dep)$$(call GetABISuffix,$$(dep))))
|
||||
ifneq ($$(EXTRA_DEPENDS),)
|
||||
Package/$(1)/DEPENDS := $$(EXTRA_DEPENDS)$$(if $$(Package/$(1)/DEPENDS),$$(comma) $$(Package/$(1)/DEPENDS))
|
||||
endif
|
||||
|
||||
$(_define) Package/$(1)/CONTROL
|
||||
Package: $(1)
|
||||
Package: $(1)$$(ABIV_$(1))
|
||||
Version: $(VERSION)
|
||||
$$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
|
||||
)$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
|
||||
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)$$(if $$(ABIV_$(1)), $(1)))
|
||||
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
|
||||
)$$(call addfield,Source,$(SOURCE)
|
||||
)$$(call addfield,SourceName,$(1)
|
||||
)$$(call addfield,License,$(LICENSE)
|
||||
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
|
||||
)$$(call addfield,Section,$(SECTION)
|
||||
@ -176,7 +181,7 @@ $(_endef)
|
||||
$$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description)
|
||||
$$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||
@rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
|
||||
@rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
|
||||
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
@ -235,7 +240,7 @@ $(_endef)
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
$(1)-clean:
|
||||
$$(if $$(call opkg_package_files,$(1)),rm -f $$(call opkg_package_files,$(1)))
|
||||
$$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*))
|
||||
|
||||
clean: $(1)-clean
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
|
||||
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
||||
mkdir -p $(TARGET_DIR)/tmp
|
||||
$(call opkg,$(TARGET_DIR)) install \
|
||||
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
|
||||
$(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
|
||||
@for file in $(PACKAGE_INSTALL_FILES); do \
|
||||
[ -s $$file.flags ] || continue; \
|
||||
for flag in `cat $$file.flags`; do \
|
||||
|
||||
@ -41,7 +41,7 @@ s=m:section(TypedSection,"main_server","<b>" .. translate("Main Server List") ..
|
||||
o=s:option(Flag,"validate",translate("validate"))
|
||||
|
||||
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
|
||||
o.datatype="ip4addr"
|
||||
|
||||
o=s:option(Value,"server_port",translate("Proxy Server Port"))
|
||||
o.datatype="uinteger"
|
||||
o=s:option(Value,"server_weight",translate("Weight"))
|
||||
@ -56,7 +56,7 @@ s=m:section(TypedSection,"backup_server","<b>" .. translate("Backup Server List"
|
||||
o=s:option(Flag,"validate",translate("validate"))
|
||||
|
||||
o=s:option(Value,"server_ip",translate("Proxy Server IP"))
|
||||
o.datatype="ip4addr"
|
||||
|
||||
o=s:option(Value,"server_port",translate("Proxy Server Port"))
|
||||
o.datatype="uinteger"
|
||||
-- ---------------------------------------------------
|
||||
|
||||
@ -14,7 +14,7 @@ msgid "Only English Characters,No spaces"
|
||||
msgstr "仅限英文字母,不要有空格"
|
||||
|
||||
msgid "Proxy Server IP"
|
||||
msgstr "代理服务器IP"
|
||||
msgstr "代理服务器IP或域名"
|
||||
|
||||
msgid "Proxy Server Port"
|
||||
msgstr "代理服务器端口"
|
||||
|
||||
@ -50,6 +50,10 @@ listen admin_stats
|
||||
stats realm Haproxy #统计页面密码框上提示文本
|
||||
stats auth admin:root #设置监控页面的用户和密码:admin,可以设置多个用户名
|
||||
stats admin if TRUE #设置手工启动/禁用,后端服务器(haproxy-1.4.9以后版本)
|
||||
resolvers mydns
|
||||
nameserver dns1 114.114.114.114:53
|
||||
nameserver dns2 223.5.5.5:53
|
||||
|
||||
frontend ss-in
|
||||
bind 127.0.0.1:2222
|
||||
default_backend ss-out
|
||||
@ -77,7 +81,7 @@ EOF
|
||||
fi
|
||||
echo the main server $COUNTER $server_ip $server_name $server_port $server_weight
|
||||
[ "$validate" = 1 ] && {
|
||||
echo server $server_name $server_ip:$server_port weight $server_weight maxconn 1024 check inter 1500 rise 3 fall 3 >> $CFG_FILE
|
||||
echo server $server_name $server_ip:$server_port weight $server_weight maxconn 1024 check resolvers mydns inter 1500 rise 3 fall 3 >> $CFG_FILE
|
||||
}
|
||||
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
|
||||
COUNTER=$(($COUNTER+1))
|
||||
@ -96,7 +100,7 @@ EOF
|
||||
fi
|
||||
echo the backup server $COUNTER $server_ip $server_name $server_port
|
||||
[ "$validate" = 1 ] && {
|
||||
echo server $server_name $server_ip:$server_port weight 10 check backup inter 1500 rise 3 fall 3 >> $CFG_FILE
|
||||
echo server $server_name $server_ip:$server_port weight 10 check resolvers mydns backup inter 1500 rise 3 fall 3 >> $CFG_FILE
|
||||
}
|
||||
iptables -t nat -A HAPROXY -p tcp -d $server_ip -j ACCEPT
|
||||
COUNTER=$(($COUNTER+1))
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=146
|
||||
PKG_VERSION:=147
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ end
|
||||
|
||||
o = s:option(DummyValue, "switch_enable", translate("Auto Switch"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "0"
|
||||
return Value.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "server_port", translate("Socket Connected"))
|
||||
|
||||
@ -211,16 +211,16 @@
|
||||
} else {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = b64decsafe(url0);
|
||||
var sstr = url0;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "trojan";
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1];
|
||||
var password = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
var port = serverPart[1].split('?')[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = serverPart[0];
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = port;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = password;
|
||||
if (param != undefined) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ start_redir() {
|
||||
pdnsd_enable_flag=1
|
||||
fi
|
||||
if [ "$(uci_get_by_type global enable_switch)" == "1" ]; then
|
||||
if [ "$(uci_get_by_name $GLOBAL_SERVER switch_enable)" == "1" ]; then
|
||||
if [ "$(uci_get_by_name $GLOBAL_SERVER switch_enable 1)" == "1" ]; then
|
||||
if [ -z "$switch_server" ]; then
|
||||
local switch_time=$(uci_get_by_type global switch_time)
|
||||
local switch_timeout=$(uci_get_by_type global switch_timeout)
|
||||
|
||||
@ -96,7 +96,7 @@ end
|
||||
local function processData(szType, content)
|
||||
local result = {
|
||||
-- auth_enable = '0',
|
||||
switch_enable = '1',
|
||||
-- switch_enable = '1',
|
||||
type = szType,
|
||||
local_port = 1234,
|
||||
-- timeout = 60, -- 不太确定 好像是死的
|
||||
@ -228,8 +228,11 @@ local function processData(szType, content)
|
||||
-- alias 不参与 hashkey 计算
|
||||
local alias = result.alias
|
||||
result.alias = nil
|
||||
local switch_enable = result.switch_enable
|
||||
result.switch_enable = nil
|
||||
result.hashkey = md5(jsonStringify(result))
|
||||
result.alias = alias
|
||||
result.switch_enable = switch_enable
|
||||
return result
|
||||
end
|
||||
-- wget
|
||||
@ -333,7 +336,15 @@ local execute = function()
|
||||
else
|
||||
log('忽略手动添加的节点: ' .. old.alias)
|
||||
end
|
||||
|
||||
-- 保留原有节点的自动切换设置
|
||||
|
||||
if(old.switch_enable)
|
||||
then
|
||||
nodeResult.switch_enable = old.switch_enable
|
||||
end
|
||||
end)
|
||||
|
||||
for k, v in ipairs(nodeResult) do
|
||||
for kk, vv in ipairs(v) do
|
||||
if not vv._ignore then
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmasq
|
||||
PKG_VERSION:=2.80
|
||||
PKG_RELEASE:=9
|
||||
PKG_RELEASE:=12
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
|
||||
|
||||
@ -832,6 +832,8 @@ dnsmasq_start()
|
||||
append_bool "$cfg" filter_aaaa "--filter-aaaa"
|
||||
|
||||
append_parm "$cfg" logfacility "--log-facility"
|
||||
|
||||
append_parm "$cfg" mini_ttl "--min-ttl"
|
||||
|
||||
append_parm "$cfg" cachesize "--cache-size"
|
||||
append_parm "$cfg" dnsforwardmax "--dns-forward-max"
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
From 966471712184cfb3b067f2ae8dad9d8e2a896cae Mon Sep 17 00:00:00 2001
|
||||
From: Bearice Ren <bearice@icybear.net>
|
||||
Date: Tue, 20 Sep 2016 11:52:08 +0800
|
||||
Subject: [PATCH] add filter-aaaa option
|
||||
|
||||
---
|
||||
src/dnsmasq.h | 3 ++-
|
||||
src/option.c | 3 +++
|
||||
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
|
||||
@@ -259,7 +259,8 @@
|
||||
#define OPT_TFTP_APREF_MAC 56
|
||||
#define OPT_RAPID_COMMIT 57
|
||||
#define OPT_UBUS 58
|
||||
-#define OPT_LAST 59
|
||||
+#define OPT_FILTER_AAAA 59
|
||||
+#define OPT_LAST 60
|
||||
|
||||
#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
|
||||
@@ -166,6 +166,7 @@
|
||||
#define LOPT_UBUS 354
|
||||
#define LOPT_NAME_MATCH 355
|
||||
#define LOPT_CAA 356
|
||||
+#define LOPT_FILTER_AAAA 357
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
static const struct option opts[] =
|
||||
@@ -337,6 +338,7 @@
|
||||
{ "dhcp-rapid-commit", 0, 0, LOPT_RAPID_COMMIT },
|
||||
{ "dumpfile", 1, 0, LOPT_DUMPFILE },
|
||||
{ "dumpmask", 1, 0, LOPT_DUMPMASK },
|
||||
+ { "filter-aaaa", 0, 0, LOPT_FILTER_AAAA },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -515,6 +517,7 @@
|
||||
{ LOPT_RAPID_COMMIT, OPT_RAPID_COMMIT, NULL, gettext_noop("Enables DHCPv4 Rapid Commit option."), NULL },
|
||||
{ LOPT_DUMPFILE, ARG_ONE, "<path>", gettext_noop("Path to debug packet dump file"), NULL },
|
||||
{ LOPT_DUMPMASK, ARG_ONE, "<hex>", gettext_noop("Mask which packets to dump"), 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
|
||||
@@ -1878,6 +1878,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ //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
|
||||
+
|
||||
if (!ans)
|
||||
return 0; /* failed to answer a question */
|
||||
}
|
||||
|
||||
--
|
||||
108
package/network/services/dnsmasq/patches/910-mini-ttl.patch
Normal file
108
package/network/services/dnsmasq/patches/910-mini-ttl.patch
Normal file
@ -0,0 +1,108 @@
|
||||
diff --git a/src/dnsmasq.h b/src/dnsmasq.h
|
||||
--- a/src/dnsmasq.h 2018-10-19 02:21:55.000000000 +0800
|
||||
+++ b/src/dnsmasq.h 2020-01-13 10:38:16.940067371 +0800
|
||||
@@ -1017,7 +1017,7 @@
|
||||
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, 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 2018-10-19 02:21:55.000000000 +0800
|
||||
+++ b/src/option.c 2020-01-13 17:21:13.925164926 +0800
|
||||
@@ -106,6 +106,7 @@
|
||||
#define LOPT_PROXY 295
|
||||
#define LOPT_GEN_NAMES 296
|
||||
#define LOPT_MAXTTL 297
|
||||
+#define LOPT_MINTTL 397
|
||||
#define LOPT_NO_REBIND 298
|
||||
#define LOPT_LOC_REBND 299
|
||||
#define LOPT_ADD_MAC 300
|
||||
@@ -282,6 +283,7 @@
|
||||
{ "dhcp-broadcast", 2, 0, LOPT_BROADCAST },
|
||||
{ "neg-ttl", 1, 0, LOPT_NEGTTL },
|
||||
{ "max-ttl", 1, 0, LOPT_MAXTTL },
|
||||
+ { "min-ttl", 1, 0, LOPT_MINTTL },
|
||||
{ "min-cache-ttl", 1, 0, LOPT_MINCTTL },
|
||||
{ "max-cache-ttl", 1, 0, LOPT_MAXCTTL },
|
||||
{ "dhcp-alternate-port", 2, 0, LOPT_ALTPORT },
|
||||
@@ -411,6 +413,7 @@
|
||||
{ 'T', ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for replies from /etc/hosts."), NULL },
|
||||
{ LOPT_NEGTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for negative caching."), NULL },
|
||||
{ LOPT_MAXTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for maximum TTL to send to clients."), NULL },
|
||||
+ { LOPT_MINTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for minimum TTL to send to clients."), NULL },
|
||||
{ LOPT_MAXCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live ceiling for cache."), NULL },
|
||||
{ LOPT_MINCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live floor for cache."), NULL },
|
||||
{ 'u', ARG_ONE, "<username>", gettext_noop("Change to this user after startup. (defaults to %s)."), CHUSER },
|
||||
@@ -2747,6 +2750,7 @@
|
||||
case 'T': /* --local-ttl */
|
||||
case LOPT_NEGTTL: /* --neg-ttl */
|
||||
case LOPT_MAXTTL: /* --max-ttl */
|
||||
+ case LOPT_MINTTL: /* --min-ttl */
|
||||
case LOPT_MINCTTL: /* --min-cache-ttl */
|
||||
case LOPT_MAXCTTL: /* --max-cache-ttl */
|
||||
case LOPT_AUTHTTL: /* --auth-ttl */
|
||||
@@ -2759,6 +2763,8 @@
|
||||
daemon->neg_ttl = (unsigned long)ttl;
|
||||
else if (option == LOPT_MAXTTL)
|
||||
daemon->max_ttl = (unsigned long)ttl;
|
||||
+ else if (option == LOPT_MINTTL)
|
||||
+ daemon->min_ttl = (unsigned long)ttl;
|
||||
else if (option == LOPT_MINCTTL)
|
||||
{
|
||||
if (ttl > TTL_FLOOR_LIMIT)
|
||||
diff --git a/src/rfc1035.c b/src/rfc1035.c
|
||||
--- a/src/rfc1035.c 2018-10-19 02:21:55.000000000 +0800
|
||||
+++ b/src/rfc1035.c 2020-01-13 17:12:25.455445871 +0800
|
||||
@@ -664,11 +664,20 @@
|
||||
GETSHORT(aqtype, p1);
|
||||
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;
|
||||
|
||||
@@ -755,11 +764,20 @@
|
||||
GETSHORT(aqtype, p1);
|
||||
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;
|
||||
|
||||
15
scripts/ipkg-remove
Executable file
15
scripts/ipkg-remove
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sourcename="$1"; shift
|
||||
|
||||
for pkg in "$@"; do
|
||||
tar -Ozxf "$pkg" ./control.tar.gz 2>/dev/null | tar -Ozxf - ./control 2>/dev/null | \
|
||||
while read field value; do
|
||||
if [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ]; then
|
||||
rm -vf "$pkg"
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
exit 0
|
||||
Loading…
Reference in New Issue
Block a user