mirror of
https://github.com/bol-van/zapret.git
synced 2026-09-17 22:12:00 +09:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87e058624c | |||
| 906665d9a5 | |||
| f97c22e96f | |||
| 9fb1f24808 | |||
| 1a1fc38c8e | |||
| 42a9b8e330 | |||
| 363fbe6943 |
@@ -94,7 +94,7 @@ jobs:
|
||||
OPTIMIZE=-Os
|
||||
;;
|
||||
arm)
|
||||
CPU="-mcpu=cortex-a7 -mthumb"
|
||||
CPU="-mcpu=arm1176jzf-s -mthumb"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -611,3 +611,10 @@ install_easy: fix writing of ask_list variables
|
||||
* github: reduce binaries size
|
||||
* github: use 16K page size for android arm64 build
|
||||
* nfqws: join fragments in quic CRYPTO reconstruction. allow intersections.
|
||||
|
||||
72.13
|
||||
|
||||
* github: compile armv6. fix idiv illegal instruction on early armv7
|
||||
* init.d: add port range for discord media
|
||||
* init.d: remove KillMode=none in systemd unit
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@ This software is free and open source under [MIT license](./LICENSE.txt).
|
||||
If anyone demands you to download this software only from their webpage, telegram channel, forces you to delete links, videos, makes copyright claims, you are dealing with scammers.
|
||||
However, [donations](#donations) are welcome.
|
||||
|
||||
# zapret2
|
||||
|
||||
zapret 1 is EOL (End-Of-Life). Will be no more new features, no PR will be accepted.
|
||||
Current version is [zapret2](https://github.com/bol-van/zapret2).
|
||||
|
||||
# Multilanguage/Мультиязычный README
|
||||
___
|
||||
[](https://github.com/bol-van/zapret/tree/master/docs/readme.en.md)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ zapret является свободным и open source.
|
||||
|
||||
# zapret2
|
||||
|
||||
Эта версия zapret более не развивается и находится в режиме EOL (End-Of-Life). Никаких новых функций больше не будет. Только багфиксы.
|
||||
Эта версия zapret более не развивается и находится в режиме EOL (End-Of-Life). Никаких новых функций больше не будет. Только багфиксы. Pull реквесты с новыми фичами не принимаются.
|
||||
|
||||
[Актуальная версия - zapret 2](https://github.com/bol-van/zapret2)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
# can override in config :
|
||||
NFQWS_OPT_DESYNC_DISCORD_MEDIA="${NFQWS_OPT_DESYNC_DISCORD_MEDIA:---dpi-desync=fake --dpi-desync-repeats=2}"
|
||||
DISCORD_MEDIA_PORT_RANGE="${DISCORD_MEDIA_PORT_RANGE:-50000-50099}"
|
||||
DISCORD_MEDIA_PORT_RANGE="${DISCORD_MEDIA_PORT_RANGE:-50000-50099,19294-19344}"
|
||||
|
||||
alloc_dnum DNUM_DISCORD_MEDIA
|
||||
alloc_qnum QNUM_DISCORD_MEDIA
|
||||
@@ -21,7 +21,7 @@ zapret_custom_firewall()
|
||||
|
||||
local DISABLE_IPV6=1
|
||||
local port_range=$(replace_char - : $DISCORD_MEDIA_PORT_RANGE)
|
||||
local f="-p udp --dport $port_range -m u32 --u32"
|
||||
local f="-p udp -m multiport --dports $port_range -m u32 --u32"
|
||||
# this is simplified test to skip writing monstrous rule. instead of checking 64 bytes for zeroes only check 2 dwords for zero
|
||||
fw_nfqws_post $1 "$f 0>>22&0x3C@4>>16=0x52&&0>>22&0x3C@8=0x00010046&&0>>22&0x3C@16=0&&0>>22&0x3C@76=0" '' $QNUM_DISCORD_MEDIA
|
||||
}
|
||||
@@ -30,6 +30,7 @@ zapret_custom_firewall_nft()
|
||||
# stop logic is not required
|
||||
|
||||
local DISABLE_IPV6=1
|
||||
local f="udp dport $DISCORD_MEDIA_PORT_RANGE udp length == 82 @ih,0,32 0x00010046 @ih,64,128 0x00000000000000000000000000000000 @ih,192,128 0x00000000000000000000000000000000 @ih,320,128 0x00000000000000000000000000000000 @ih,448,128 0x00000000000000000000000000000000"
|
||||
local f="udp dport {$DISCORD_MEDIA_PORT_RANGE} udp length == 82 @ih,0,32 0x00010046 @ih,64,128 0x00000000000000000000000000000000 @ih,192,128 0x00000000000000000000000000000000 @ih,320,128 0x00000000000000000000000000000000 @ih,448,128 0x00000000000000000000000000000000"
|
||||
|
||||
nft_fw_nfqws_post "$f" '' $QNUM_DISCORD_MEDIA
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ Type=forking
|
||||
Restart=no
|
||||
TimeoutSec=30sec
|
||||
IgnoreSIGPIPE=no
|
||||
KillMode=none
|
||||
GuessMainPID=no
|
||||
RemainAfterExit=no
|
||||
ExecStart=/opt/zapret/init.d/sysv/zapret start
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
outbound and ip and
|
||||
udp.DstPort>=50000 and udp.DstPort<=50099 and
|
||||
(udp.DstPort>=50000 and udp.DstPort<=50099 or udp.DstPort>=19294 and udp.DstPort<=19344) and
|
||||
udp.PayloadLength=74 and
|
||||
udp.Payload32[0]=0x00010046 and
|
||||
udp.Payload32[2]=0 and
|
||||
|
||||
+4
-2
@@ -221,7 +221,8 @@ void print_sockaddr(const struct sockaddr *sa)
|
||||
|
||||
bool pton4_port(const char *s, struct sockaddr_in *sa)
|
||||
{
|
||||
char ip[16],*p;
|
||||
char ip[16];
|
||||
const char *p;
|
||||
size_t l;
|
||||
unsigned int u;
|
||||
|
||||
@@ -241,7 +242,8 @@ bool pton4_port(const char *s, struct sockaddr_in *sa)
|
||||
}
|
||||
bool pton6_port(const char *s, struct sockaddr_in6 *sa)
|
||||
{
|
||||
char ip[40],*p;
|
||||
char ip[40];
|
||||
const char *p;
|
||||
size_t l;
|
||||
unsigned int u;
|
||||
|
||||
|
||||
+1
-1
@@ -587,7 +587,7 @@ static uint8_t tvb_get_varint(const uint8_t *tvb, uint64_t *value)
|
||||
return 8;
|
||||
}
|
||||
// impossible case
|
||||
if (*value) *value = 0;
|
||||
if (value) *value = 0;
|
||||
return 0;
|
||||
}
|
||||
static uint8_t tvb_get_size(uint8_t tvb)
|
||||
|
||||
+1
-4
@@ -835,8 +835,6 @@ static bool handle_unsent(tproxy_conn_t *conn)
|
||||
|
||||
static bool proxy_mode_connect_remote(tproxy_conn_t *conn, struct tailhead *conn_list)
|
||||
{
|
||||
int remote_fd;
|
||||
|
||||
if (params.debug>=1)
|
||||
{
|
||||
char ip_port[48];
|
||||
@@ -850,9 +848,8 @@ static bool proxy_mode_connect_remote(tproxy_conn_t *conn, struct tailhead *conn
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(conn->partner = new_conn(remote_fd, true)))
|
||||
if (!(conn->partner = new_conn(0, true)))
|
||||
{
|
||||
close(remote_fd);
|
||||
DLOG_ERR("socks out-of-memory (1)\n");
|
||||
socks_send_rep(conn->socks_ver, conn->fd, S5_REP_GENERAL_FAILURE);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user