CN-IPV6绕过哈希表增大到4096

使用mihomo的ipv6的cn列表有3300条左右,增加哈希表大小兼容更多的条目
This commit is contained in:
Qixiong Yuan 2024-01-29 16:05:29 +08:00 committed by GitHub
parent 1a621cb4a0
commit 4300c4a028
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -794,7 +794,7 @@ cn_ipv6_route(){ #CN-IPV6绕过
[ -f ${BINDIR}/cn_ipv6.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && { [ -f ${BINDIR}/cn_ipv6.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && {
#ipv6 #ipv6
#see https://ispip.clang.cn/all_cn_ipv6.txt #see https://ispip.clang.cn/all_cn_ipv6.txt
echo "create cn_ip6 hash:net family inet6 hashsize 2048 maxelem 2048" > ${TMPDIR}/cn6_$USER.ipset echo "create cn_ip6 hash:net family inet6 hashsize 4096 maxelem 4096" > ${TMPDIR}/cn6_$USER.ipset
awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' ${BINDIR}/cn_ipv6.txt >> ${TMPDIR}/cn6_$USER.ipset awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' ${BINDIR}/cn_ipv6.txt >> ${TMPDIR}/cn6_$USER.ipset
ipset -! flush cn_ip6 2>/dev/null ipset -! flush cn_ip6 2>/dev/null
ipset -! restore < ${TMPDIR}/cn6_$USER.ipset ipset -! restore < ${TMPDIR}/cn6_$USER.ipset