Compare commits

...

7 Commits

Author SHA1 Message Date
bol-van 87e058624c update docs 2026-07-21 09:17:51 +03:00
bol-van 906665d9a5 nfqws: fix minor compile warning 2026-07-21 09:14:01 +03:00
bol-van f97c22e96f init.d: discord media add port range 2026-07-21 09:10:49 +03:00
bol-van 9fb1f24808 init.d: remove KillMode=none in systemd unit 2026-07-21 09:08:52 +03:00
bol-van 1a1fc38c8e minor static analyzer fixes 2026-06-06 10:09:35 +03:00
bol-van 42a9b8e330 update docs 2026-05-09 08:14:30 +03:00
bol-van 363fbe6943 github: remove sdiv crash on old armv7 2026-03-12 20:55:17 +03:00
10 changed files with 25 additions and 14 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ jobs:
OPTIMIZE=-Os OPTIMIZE=-Os
;; ;;
arm) arm)
CPU="-mcpu=cortex-a7 -mthumb" CPU="-mcpu=arm1176jzf-s -mthumb"
;; ;;
esac esac
+7
View File
@@ -611,3 +611,10 @@ install_easy: fix writing of ask_list variables
* github: reduce binaries size * github: reduce binaries size
* github: use 16K page size for android arm64 build * github: use 16K page size for android arm64 build
* nfqws: join fragments in quic CRYPTO reconstruction. allow intersections. * 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
+5
View File
@@ -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. 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. 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 # Multilanguage/Мультиязычный README
___ ___
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.en.md) [![en](https://img.shields.io/badge/lang-en-red.svg)](https://github.com/bol-van/zapret/tree/master/docs/readme.en.md)
+1 -1
View File
@@ -6,7 +6,7 @@ zapret является свободным и open source.
# zapret2 # zapret2
Эта версия zapret более не развивается и находится в режиме EOL (End-Of-Life). Никаких новых функций больше не будет. Только багфиксы. Эта версия zapret более не развивается и находится в режиме EOL (End-Of-Life). Никаких новых функций больше не будет. Только багфиксы. Pull реквесты с новыми фичами не принимаются.
[Актуальная версия - zapret 2](https://github.com/bol-van/zapret2) [Актуальная версия - zapret 2](https://github.com/bol-van/zapret2)
@@ -3,7 +3,7 @@
# can override in config : # can override in config :
NFQWS_OPT_DESYNC_DISCORD_MEDIA="${NFQWS_OPT_DESYNC_DISCORD_MEDIA:---dpi-desync=fake --dpi-desync-repeats=2}" 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_dnum DNUM_DISCORD_MEDIA
alloc_qnum QNUM_DISCORD_MEDIA alloc_qnum QNUM_DISCORD_MEDIA
@@ -21,7 +21,7 @@ zapret_custom_firewall()
local DISABLE_IPV6=1 local DISABLE_IPV6=1
local port_range=$(replace_char - : $DISCORD_MEDIA_PORT_RANGE) 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 # 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 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 # stop logic is not required
local DISABLE_IPV6=1 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 nft_fw_nfqws_post "$f" '' $QNUM_DISCORD_MEDIA
} }
-1
View File
@@ -7,7 +7,6 @@ Type=forking
Restart=no Restart=no
TimeoutSec=30sec TimeoutSec=30sec
IgnoreSIGPIPE=no IgnoreSIGPIPE=no
KillMode=none
GuessMainPID=no GuessMainPID=no
RemainAfterExit=no RemainAfterExit=no
ExecStart=/opt/zapret/init.d/sysv/zapret start ExecStart=/opt/zapret/init.d/sysv/zapret start
@@ -1,5 +1,5 @@
outbound and ip and 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.PayloadLength=74 and
udp.Payload32[0]=0x00010046 and udp.Payload32[0]=0x00010046 and
udp.Payload32[2]=0 and udp.Payload32[2]=0 and
+4 -2
View File
@@ -221,7 +221,8 @@ void print_sockaddr(const struct sockaddr *sa)
bool pton4_port(const char *s, struct sockaddr_in *sa) bool pton4_port(const char *s, struct sockaddr_in *sa)
{ {
char ip[16],*p; char ip[16];
const char *p;
size_t l; size_t l;
unsigned int u; 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) bool pton6_port(const char *s, struct sockaddr_in6 *sa)
{ {
char ip[40],*p; char ip[40];
const char *p;
size_t l; size_t l;
unsigned int u; unsigned int u;
+1 -1
View File
@@ -587,7 +587,7 @@ static uint8_t tvb_get_varint(const uint8_t *tvb, uint64_t *value)
return 8; return 8;
} }
// impossible case // impossible case
if (*value) *value = 0; if (value) *value = 0;
return 0; return 0;
} }
static uint8_t tvb_get_size(uint8_t tvb) static uint8_t tvb_get_size(uint8_t tvb)
+1 -4
View File
@@ -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) static bool proxy_mode_connect_remote(tproxy_conn_t *conn, struct tailhead *conn_list)
{ {
int remote_fd;
if (params.debug>=1) if (params.debug>=1)
{ {
char ip_port[48]; char ip_port[48];
@@ -850,9 +848,8 @@ static bool proxy_mode_connect_remote(tproxy_conn_t *conn, struct tailhead *conn
return false; 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"); DLOG_ERR("socks out-of-memory (1)\n");
socks_send_rep(conn->socks_ver, conn->fd, S5_REP_GENERAL_FAILURE); socks_send_rep(conn->socks_ver, conn->fd, S5_REP_GENERAL_FAILURE);
return false; return false;