From f97c22e96f09a083c88cc6c59ee4670e59ad983f Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 21 Jul 2026 09:10:49 +0300 Subject: [PATCH] init.d: discord media add port range --- init.d/custom.d.examples.linux/50-discord-media | 7 ++++--- .../windivert_part.discord_media.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/init.d/custom.d.examples.linux/50-discord-media b/init.d/custom.d.examples.linux/50-discord-media index 2601bcbc..575f540c 100644 --- a/init.d/custom.d.examples.linux/50-discord-media +++ b/init.d/custom.d.examples.linux/50-discord-media @@ -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 } diff --git a/init.d/windivert.filter.examples/windivert_part.discord_media.txt b/init.d/windivert.filter.examples/windivert_part.discord_media.txt index 26c2014b..d84f257a 100644 --- a/init.d/windivert.filter.examples/windivert_part.discord_media.txt +++ b/init.d/windivert.filter.examples/windivert_part.discord_media.txt @@ -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