mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
package: fix issues (#2831)
This commit is contained in:
parent
8840d7c303
commit
4f32be505b
@ -5,36 +5,36 @@ START=99
|
||||
|
||||
start()
|
||||
{
|
||||
rfc=4096
|
||||
cc=$(grep -c processor /proc/cpuinfo)
|
||||
rsfe=$(echo $cc*$rfc | bc)
|
||||
sysctl -w net.core.rps_sock_flow_entries=$rsfe
|
||||
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
|
||||
do
|
||||
echo $cc > $fileRps
|
||||
done
|
||||
|
||||
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
|
||||
do
|
||||
echo $rfc > $fileRfc
|
||||
done
|
||||
rfc=4096
|
||||
cc=$(grep -c processor /proc/cpuinfo)
|
||||
rsfe=$(echo $cc*$rfc | bc)
|
||||
sysctl -w net.core.rps_sock_flow_entries=$rsfe
|
||||
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
|
||||
do
|
||||
echo $cc > $fileRps
|
||||
done
|
||||
|
||||
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
|
||||
do
|
||||
echo $rfc > $fileRfc
|
||||
done
|
||||
|
||||
for fileRps in $(ls /sys/class/net/eth*/queues/tx-*/xps_cpus)
|
||||
do
|
||||
echo $cc > $fileRps
|
||||
done
|
||||
|
||||
a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq)
|
||||
b=$(echo -n ' : ')
|
||||
c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l)
|
||||
d=$(echo -n ' Core ')
|
||||
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
|
||||
f=$(echo -n ' Thread ')
|
||||
g=${a}${b}${c}${d}${e}${f}
|
||||
|
||||
mkdir -p /tmp/sysinfo
|
||||
echo $g > /tmp/sysinfo/model
|
||||
|
||||
for fileRps in $(ls /sys/class/net/eth*/queues/tx-*/xps_cpus)
|
||||
do
|
||||
echo $cc > $fileRps
|
||||
done
|
||||
|
||||
a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq)
|
||||
b=$(echo -n ' : ')
|
||||
c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l)
|
||||
d=$(echo -n ' Core ')
|
||||
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
|
||||
f=$(echo -n ' Thread ')
|
||||
g=${a}${b}${c}${d}${e}${f}
|
||||
|
||||
mkdir -p /tmp/sysinfo
|
||||
echo $g > /tmp/sysinfo/model
|
||||
|
||||
a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.")
|
||||
b=$(echo "$a" | wc -l)
|
||||
for i in $(seq 1 $b)
|
||||
@ -49,9 +49,6 @@ start()
|
||||
ethtool -K $c tso on >/dev/null 2>&1
|
||||
ethtool -K $c ufo on >/dev/null 2>&1
|
||||
done
|
||||
|
||||
[ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm
|
||||
|
||||
[ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -2,19 +2,17 @@
|
||||
|
||||
info()
|
||||
{
|
||||
|
||||
#获取CPU工作频率
|
||||
MHz=`grep 'MHz' /proc/cpuinfo | cut -c11- |sed -n '1p'`
|
||||
#获取CPU工作频率
|
||||
|
||||
sensors >/dev/null
|
||||
|
||||
if [ $? -eq 0 ];then
|
||||
|
||||
a=`sensors | grep 'Core 0' | cut -c10-24`
|
||||
#获取CPU核心1温度
|
||||
a=`sensors | grep 'Core 0' | cut -c10-24`
|
||||
|
||||
else
|
||||
a=""
|
||||
a=""
|
||||
fi
|
||||
}
|
||||
|
||||
@ -25,4 +23,3 @@ out()
|
||||
}
|
||||
|
||||
out
|
||||
|
||||
|
@ -8,25 +8,25 @@ echo -n "[" > /tmp/state/ethinfo
|
||||
|
||||
for i in $(seq 1 $b)
|
||||
do
|
||||
h=$(echo '{"name":' )
|
||||
h=$(echo '{"name":' )
|
||||
c=$(echo "$a" | sed -n ${i}p)
|
||||
d=$(ethtool $c)
|
||||
|
||||
|
||||
e=$(echo "$d" | grep "Link detected" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g')
|
||||
if [ $e = yes ]; then
|
||||
l=1
|
||||
else
|
||||
l=0
|
||||
l=1
|
||||
else
|
||||
l=0
|
||||
fi
|
||||
|
||||
f=$(echo "$d" | grep "Speed" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g' | tr -d "Unknown!")
|
||||
[ -z "$f" ] && f=" - "
|
||||
|
||||
|
||||
g=$(echo "$d" | grep "Duplex" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g')
|
||||
if [ "$g" == "Full" ]; then
|
||||
x=1
|
||||
else
|
||||
x=0
|
||||
x=1
|
||||
else
|
||||
x=0
|
||||
fi
|
||||
|
||||
echo -n "$h \"$c\", \"status\": $l, \"speed\": \"$f\", \"duplex\": $x}," >> /tmp/state/ethinfo
|
||||
|
@ -10,18 +10,18 @@ skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
|
||||
path=$DEVPATH
|
||||
|
||||
if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
|
||||
mntpnt=$device
|
||||
case "$ACTION" in
|
||||
add)
|
||||
mkdir -p /mnt/$mntpnt
|
||||
chmod 777 /mnt/$mntpnt
|
||||
# Try to be gentle on solid state devices
|
||||
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
|
||||
;;
|
||||
remove)
|
||||
# Once the device is removed, the /dev entry disappear. We need mountpoint
|
||||
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
|
||||
umount -l $mountpoint
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
mntpnt=$device
|
||||
case "$ACTION" in
|
||||
add)
|
||||
mkdir -p /mnt/$mntpnt
|
||||
chmod 777 /mnt/$mntpnt
|
||||
# Try to be gentle on solid state devices
|
||||
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
|
||||
;;
|
||||
remove)
|
||||
# Once the device is removed, the /dev entry disappear. We need mountpoint
|
||||
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
|
||||
umount -l $mountpoint
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -2,6 +2,3 @@
|
||||
|
||||
sleep 15
|
||||
mv /etc/15-automount /etc/hotplug.d/block/
|
||||
|
||||
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# D-Team Technology Co.,Ltd. ShenZhen
|
||||
# 作者:Vic
|
||||
#
|
||||
|
||||
#
|
||||
# D-Team Technology Co.,Ltd. ShenZhen
|
||||
# 作者:Vic
|
||||
#
|
||||
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/service.sh
|
||||
|
||||
@ -13,20 +14,20 @@ global=0
|
||||
config_file="/etc/config/samba"
|
||||
|
||||
wait_for_init() {
|
||||
for i in `seq 30`
|
||||
do
|
||||
[ -e /tmp/procd.done ] || {
|
||||
sleep 1; continue;
|
||||
}
|
||||
return
|
||||
done
|
||||
for i in `seq 30`
|
||||
do
|
||||
[ -e /tmp/procd.done ] || {
|
||||
sleep 1; continue;
|
||||
}
|
||||
return
|
||||
done
|
||||
}
|
||||
|
||||
smb_handle() {
|
||||
config_get path $1 path
|
||||
if [ "$path" = "$2" ] ;then
|
||||
global=1
|
||||
fi
|
||||
config_get path $1 path
|
||||
if [ "$path" = "$2" ] ;then
|
||||
global=1
|
||||
fi
|
||||
}
|
||||
|
||||
chk_en() {
|
||||
@ -41,53 +42,53 @@ device=`basename $DEVPATH`
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
|
||||
case "$device" in
|
||||
sd*) ;;
|
||||
md*) ;;
|
||||
hd*);;
|
||||
mmcblk*);;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
path="/dev/$device"
|
||||
|
||||
wait_for_init
|
||||
case "$device" in
|
||||
sd*);;
|
||||
md*);;
|
||||
hd*);;
|
||||
mmcblk*);;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
cat /proc/mounts | while read j
|
||||
do
|
||||
str=${j%% *}
|
||||
if [ "$str" == $path ];then
|
||||
strr=${j#* }
|
||||
target=${strr%% *}
|
||||
global=0
|
||||
config_foreach smb_handle sambashare $target
|
||||
name=${target#*/mnt/}
|
||||
path="/dev/$device"
|
||||
|
||||
if [ $global -eq 0 ] ;then
|
||||
echo -e "\n\nconfig sambashare" >> $config_file
|
||||
echo -e "\toption auto '1'" >> $config_file
|
||||
echo -e "\toption name '$name'" >> $config_file
|
||||
echo -e "\toption path '$target'" >> $config_file
|
||||
echo -e "\toption read_only 'no'" >> $config_file
|
||||
echo -e "\toption guest_ok 'yes'" >> $config_file
|
||||
echo -e "\toption create_mask '0666'" >> $config_file
|
||||
echo -e "\toption dir_mask '0777'" >> $config_file
|
||||
echo -e "\toption device '$device'" >> $config_file
|
||||
wait_for_init
|
||||
|
||||
cat /proc/mounts | while read j
|
||||
do
|
||||
str=${j%% *}
|
||||
if [ "$str" == $path ];then
|
||||
strr=${j#* }
|
||||
target=${strr%% *}
|
||||
global=0
|
||||
config_foreach smb_handle sambashare $target
|
||||
name=${target#*/mnt/}
|
||||
|
||||
if [ $global -eq 0 ] ;then
|
||||
echo -e "\n\nconfig sambashare" >> $config_file
|
||||
echo -e "\toption auto '1'" >> $config_file
|
||||
echo -e "\toption name '$name'" >> $config_file
|
||||
echo -e "\toption path '$target'" >> $config_file
|
||||
echo -e "\toption read_only 'no'" >> $config_file
|
||||
echo -e "\toption guest_ok 'yes'" >> $config_file
|
||||
echo -e "\toption create_mask '0666'" >> $config_file
|
||||
echo -e "\toption dir_mask '0777'" >> $config_file
|
||||
echo -e "\toption device '$device'" >> $config_file
|
||||
/etc/init.d/samba reload
|
||||
return
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
remove)
|
||||
i=0
|
||||
while true
|
||||
do
|
||||
|
||||
dev=`uci get samba.@sambashare[$i].device`
|
||||
[ $? -ne 0 ] && break
|
||||
|
||||
|
||||
[ "$dev" = "$device" ] && {
|
||||
auto=`uci get samba.@sambashare[$i].auto`
|
||||
[ $auto = "1" ] && {
|
||||
|
@ -29,8 +29,8 @@ sed -i 's/services/nas/g' /usr/lib/lua/luci/view/minidlna_status.htm
|
||||
|
||||
ln -sf /sbin/ip /usr/bin/ip
|
||||
|
||||
#sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
|
||||
#sed -i 's/http/https/g' /etc/opkg/distfeeds.conf
|
||||
sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
|
||||
sed -i 's/http/https/g' /etc/opkg/distfeeds.conf
|
||||
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
|
||||
|
||||
sed -i "s/# //g" /etc/opkg/distfeeds.conf
|
||||
@ -57,6 +57,3 @@ rm -rf /tmp/luci-modulecache/
|
||||
rm -f /tmp/luci-indexcache
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ msgid "ZRam Settings"
|
||||
msgstr "ZRam 设置"
|
||||
|
||||
msgid "ZRam Compression Algorithm"
|
||||
msgstr "ZRAM压缩算法"
|
||||
msgstr "ZRam 压缩算法"
|
||||
|
||||
msgid "ZRam Compression Streams"
|
||||
msgstr "ZRam 压缩数据流线程数"
|
||||
|
@ -1034,4 +1034,3 @@ msgstr "警告:当前系统没有包括两个分区!"
|
||||
|
||||
msgid "Warning: This system does not support powering off!"
|
||||
msgstr "警告:本系统不支持软关机!"
|
||||
|
||||
|
@ -200,4 +200,4 @@ msgstr "最小数据包大小,MPU(byte); 在以太网中需要>0:"
|
||||
|
||||
#: usr/lib/lua/luci/model/cbi/sqm.lua:242
|
||||
msgid "Which linklayer adaptation mechanism to use; for testing only"
|
||||
msgstr "使用哪个链路适应机制; 仅用于测试"
|
||||
msgstr "使用哪个链路适应机制; 仅用于测试"
|
||||
|
@ -4,7 +4,6 @@ server 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1,208.67.222.222,208.67.220.220,209.244.0.3
|
||||
proxy no
|
||||
|
||||
|
||||
|
||||
030buy.com
|
||||
0rz.tw
|
||||
1-apple.com.tw
|
||||
@ -4039,6 +4038,8 @@ sendspace.com
|
||||
servehttp.com
|
||||
serveuser.com
|
||||
serveusers.com
|
||||
services.googleapis.cn
|
||||
services.googleapis.com
|
||||
sesawe.net
|
||||
sesawe.org
|
||||
sethwklein.net
|
||||
|
@ -132,7 +132,7 @@ get_args(){
|
||||
EXTRA_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
--exclude-domain-file)
|
||||
--exclude-domain-file)
|
||||
EXCLUDE_DOMAIN_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
@ -276,7 +276,7 @@ process(){
|
||||
if [ $WITH_IPSET -eq 1 ]; then
|
||||
_green 'Ipset rules included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'\
|
||||
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
|
||||
ipset=/\1/'$IPSET_NAME'#g' > $CONF_TMP_FILE
|
||||
else
|
||||
_green 'Ipset rules not included.'
|
||||
sort -u $DOMAIN_FILE | $SED_ERES 's#(.+)#server=/\1/'$DNS_IP'\#'$DNS_PORT'#g' > $CONF_TMP_FILE
|
||||
|
@ -3234,6 +3234,9 @@ rapidsharedata.com
|
||||
rapidvpn.com
|
||||
raremovie.cc
|
||||
raremovie.net
|
||||
raw.githubusercontent.com
|
||||
rawgit.com
|
||||
rawgithub.com
|
||||
rayfme.com
|
||||
razyboard.com
|
||||
rcinet.ca
|
||||
@ -3380,6 +3383,8 @@ sendsmtp.com
|
||||
sendspace.com
|
||||
serveuser.com
|
||||
serveusers.com
|
||||
services.googleapis.cn
|
||||
services.googleapis.com
|
||||
sesawe.net
|
||||
sesawe.org
|
||||
sethwklein.net
|
||||
|
@ -26,4 +26,3 @@ restart()
|
||||
stop >/dev/null 2>&1
|
||||
start
|
||||
}
|
||||
|
||||
|
@ -6,4 +6,3 @@ msgstr "域名列表设置"
|
||||
|
||||
msgid "Domain Lists"
|
||||
msgstr "域名列表"
|
||||
|
||||
|
@ -1939,6 +1939,9 @@ ranyunfei.com
|
||||
rapbull.net
|
||||
rapidshare8.com
|
||||
rapidsharedata.com
|
||||
raw.githubusercontent.com
|
||||
rawgit.com
|
||||
rawgithub.com
|
||||
rayfme.com
|
||||
rcinet.ca
|
||||
rconversation.blogs.com
|
||||
@ -2028,6 +2031,8 @@ seezone.net
|
||||
sejie.com
|
||||
sendoid.com
|
||||
sendspace.com
|
||||
services.googleapis.cn
|
||||
services.googleapis.com
|
||||
sesawe.net
|
||||
sesawe.org
|
||||
sethwklein.net
|
||||
|
@ -15,8 +15,8 @@ china_routes_apnic()
|
||||
[ -f apnic.txt ] || wget -4 http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O apnic.txt >&2 || exit 1
|
||||
|
||||
cat apnic.txt | awk -F'|' -vc=CN '
|
||||
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
|
||||
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
|
||||
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
|
||||
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
@ -42,7 +42,6 @@ convert_routes_to_ipset()
|
||||
awk -vt="$ipset_name" '{ printf("add %s %s\n", t, $0) }'
|
||||
}
|
||||
|
||||
|
||||
generate_china_ipset()
|
||||
{
|
||||
china_routes_merged | convert_routes_to_ipset china
|
||||
@ -54,16 +53,15 @@ generate_inverted_china_routes()
|
||||
china_routes_merged
|
||||
echo 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3
|
||||
) |
|
||||
xargs netmask -r | awk '{print $1}' |
|
||||
awk -F- '
|
||||
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
|
||||
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
|
||||
BEGIN { st=0 }
|
||||
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
xargs netmask -r | awk '{print $1}' |
|
||||
awk -F- '
|
||||
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
|
||||
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
|
||||
BEGIN { st=0 }
|
||||
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
|
||||
xargs netmask | awk '{print $1}'
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
case "$1" in
|
||||
"")
|
||||
|
@ -14,16 +14,14 @@ generate_china_banned()
|
||||
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
|
||||
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | rev | sort -u |
|
||||
awk '
|
||||
BEGIN { prev = "________"; } {
|
||||
cur = $0;
|
||||
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
|
||||
} else {
|
||||
print cur;
|
||||
prev = cur;
|
||||
}
|
||||
}' | rev | sort -u
|
||||
|
||||
BEGIN { prev = "________"; } {
|
||||
cur = $0;
|
||||
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
|
||||
} else {
|
||||
print cur;
|
||||
prev = cur;
|
||||
}
|
||||
}' | rev | sort -u
|
||||
}
|
||||
|
||||
generate_china_banned
|
||||
|
||||
|
@ -80,19 +80,19 @@ static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
|
||||
{
|
||||
struct ipv4_range *cur;
|
||||
int ret;
|
||||
|
||||
|
||||
/* Ignore a new range if it or a larger range already exists */
|
||||
//if (salist_check_ipv4(od->table, start, end))
|
||||
// return 0;
|
||||
|
||||
|
||||
if ((ret = __touch_tmp_base(od, gfp)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
/* Check if the size is efficient. Enlarge it if needed. */
|
||||
if (od->tmp_length + 1 >= od->tmp_size) {
|
||||
size_t old_size = od->tmp_size;
|
||||
struct ipv4_range *old_base = od->tmp_base;
|
||||
|
||||
|
||||
od->tmp_size *= 2;
|
||||
od->tmp_base = (struct ipv4_range *)realloc(od->tmp_base,
|
||||
sizeof(struct ipv4_range) * od->tmp_size);
|
||||
@ -102,11 +102,11 @@ static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cur = &od->tmp_base[od->tmp_length++];
|
||||
cur->start = start;
|
||||
cur->end = end;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ static inline int ipv4_list_add_netmask(struct sa_open_data *od,
|
||||
{
|
||||
u32 start = net & net_mask;
|
||||
u32 end = net | ~net_mask;
|
||||
|
||||
|
||||
return ipv4_list_add_range(od, start, end, gfp);
|
||||
}
|
||||
|
||||
@ -141,12 +141,12 @@ static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
|
||||
int n = 32;
|
||||
|
||||
/* Case 3: Append an item */
|
||||
|
||||
|
||||
/* Check IP description part: network segment or range? */
|
||||
if ((sep = strchr(cmd, '/'))) { }
|
||||
else if ((sep = strchr(cmd, '-'))) { }
|
||||
else if ((sep = strchr(cmd, ':'))) { }
|
||||
|
||||
|
||||
if (sep) {
|
||||
/* Describes a subnet or range. */
|
||||
sc = *sep;
|
||||
@ -164,7 +164,7 @@ static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
|
||||
sc = '\0';
|
||||
a1 = cmd;
|
||||
}
|
||||
|
||||
|
||||
switch (sc) {
|
||||
case '/':
|
||||
/* 10.10.20.0/24 */
|
||||
@ -204,7 +204,7 @@ static int ipv4_range_sort_cmp(const void *a, const void *b)
|
||||
{
|
||||
struct ipv4_range *ra = (struct ipv4_range *)a;
|
||||
struct ipv4_range *rb = (struct ipv4_range *)b;
|
||||
|
||||
|
||||
if (ra->start > rb->start) {
|
||||
return 1;
|
||||
} else if (ra->start < rb->start) {
|
||||
@ -269,10 +269,10 @@ static int salist_close(struct sa_open_data *od)
|
||||
od->tmp_base[wi] = od->tmp_base[ri];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
od->tmp_length = wi + 1;
|
||||
}
|
||||
|
||||
|
||||
/* Reduce the size */
|
||||
if (od->tmp_length < od->tmp_size) {
|
||||
struct ipv4_range *__tmp = od->tmp_base;
|
||||
@ -292,7 +292,7 @@ static int salist_close(struct sa_open_data *od)
|
||||
|
||||
/* Dump the table instead */
|
||||
}
|
||||
|
||||
|
||||
if (od->errors) {
|
||||
fprintf(stderr, "[%s] %d errors detected during table operation.\n",
|
||||
__FUNCTION__, od->errors);
|
||||
@ -336,4 +336,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -68,4 +68,4 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client_linux_$(PKG_ARCH_KCPTUN) $(1)/usr/bin/kcptun-client
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
@ -43,7 +43,6 @@ sec.resource.xiaomi.net
|
||||
calopenupdate.comm.miui.com
|
||||
hm.xiaomi.com
|
||||
api.device.xiaomi.net
|
||||
connect.rom.miui.com
|
||||
logupdate.avlyun.sec.miui.com
|
||||
resolver.msg.xiaomi.net
|
||||
api.ra2.xlmc.sec.miui.com
|
||||
|
Loading…
Reference in New Issue
Block a user