mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-29 21:40:52 +03:00
Compare commits
3 Commits
4e8766f245
...
5b8a38e30e
Author | SHA1 | Date | |
---|---|---|---|
|
5b8a38e30e | ||
|
4febb74b0d | ||
|
23f2de8014 |
Binary file not shown.
Binary file not shown.
@ -24,7 +24,7 @@ DESYNC_MARK=0x10000000
|
||||
IPFW_RULE_NUM=${IPFW_RULE_NUM:-1}
|
||||
IPFW_DIVERT_PORT=${IPFW_DIVERT_PORT:-59780}
|
||||
DOMAINS=${DOMAINS:-rutracker.org}
|
||||
CURL_MAX_TIME=${CURL_MAX_TIME:-3}
|
||||
CURL_MAX_TIME=${CURL_MAX_TIME:-2}
|
||||
CURL_MAX_TIME_QUIC=${CURL_MAX_TIME_QUIC:-$CURL_MAX_TIME}
|
||||
MIN_TTL=${MIN_TTL:-1}
|
||||
MAX_TTL=${MAX_TTL:-12}
|
||||
@ -1353,8 +1353,13 @@ pingtest()
|
||||
ping -c 1 -w 1 $1 >/dev/null
|
||||
;;
|
||||
CYGWIN)
|
||||
# cygwin does not have own PING by default. use windows PING.
|
||||
ping -n 1 -w 1000 $1 >/dev/null
|
||||
if starts_with "$(which ping)" /cygdrive; then
|
||||
# cygwin does not have own PING by default. use windows PING.
|
||||
ping -n 1 -w 1000 $1 >/dev/null
|
||||
else
|
||||
# they have installed cygwin ping
|
||||
ping -c 1 -W 1 $1 >/dev/null
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
ping -c 1 -W 1 $1 >/dev/null
|
||||
|
@ -49,6 +49,17 @@ contains()
|
||||
# check if substring $2 contains in $1
|
||||
[ "${1#*$2}" != "$1" ]
|
||||
}
|
||||
starts_with()
|
||||
{
|
||||
# $1 : what
|
||||
# $2 : starts with
|
||||
case "$1" in
|
||||
"$2"*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
find_str_in_list()
|
||||
{
|
||||
[ -n "$1" ] && {
|
||||
@ -290,7 +301,7 @@ shell_name()
|
||||
SHELL_NAME=$(ps -p $$ -o comm=)
|
||||
fi
|
||||
|
||||
[ -n "$SHELL_NAME" ] || SHELL_NAME=$(basename "$SHELL")
|
||||
[ -n "$SHELL_NAME" ] || SHELL_NAME="$(basename "$SHELL")"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1037,6 +1037,7 @@ static bool windivert_recv_filter(HANDLE hFilter, uint8_t *packet, size_t *len,
|
||||
errno=EINTR;
|
||||
return false;
|
||||
}
|
||||
usleep(0);
|
||||
if (WinDivertRecvEx(hFilter, packet, *len, &recv_len, 0, wa, NULL, &ovl))
|
||||
{
|
||||
*len = recv_len;
|
||||
|
19
nfq/nfqws.c
19
nfq/nfqws.c
@ -444,17 +444,20 @@ static int win_main(const char *windivert_filter)
|
||||
DLOG("packet: id=%u len=%zu %s IPv6=%u IPChecksum=%u TCPChecksum=%u UDPChecksum=%u IfIdx=%u.%u\n", id, len, wa.Outbound ? "outbound" : "inbound", wa.IPv6, wa.IPChecksum, wa.TCPChecksum, wa.UDPChecksum, wa.Network.IfIdx, wa.Network.SubIfIdx)
|
||||
if (wa.Impostor)
|
||||
{
|
||||
DLOG("windivert: skipping impostor packet\n")
|
||||
continue;
|
||||
DLOG("windivert: passing impostor packet\n")
|
||||
verdict = VERDICT_PASS;
|
||||
}
|
||||
if (wa.Loopback)
|
||||
else if (wa.Loopback)
|
||||
{
|
||||
DLOG("windivert: skipping loopback packet\n")
|
||||
continue;
|
||||
DLOG("windivert: passing loopback packet\n")
|
||||
verdict = VERDICT_PASS;
|
||||
}
|
||||
else
|
||||
{
|
||||
mark=0;
|
||||
// pseudo interface id IfIdx.SubIfIdx
|
||||
verdict = processPacketData(&mark, ifout, packet, &len);
|
||||
}
|
||||
mark=0;
|
||||
// pseudo interface id IfIdx.SubIfIdx
|
||||
verdict = processPacketData(&mark, ifout, packet, &len);
|
||||
switch (verdict & VERDICT_MASK)
|
||||
{
|
||||
case VERDICT_PASS:
|
||||
|
Loading…
Reference in New Issue
Block a user