mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-20 22:12:58 +03:00
Compare commits
3 Commits
63256a142f
...
8fce75daa4
Author | SHA1 | Date | |
---|---|---|---|
|
8fce75daa4 | ||
|
c1e2e56576 | ||
|
e16ec69922 |
@ -111,6 +111,14 @@ unprepare_route_localnet()
|
|||||||
set_route_localnet 0 "$@"
|
set_route_localnet 0 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_uevent_devtype()
|
||||||
|
{
|
||||||
|
local DEVTYPE INTERFACE IFINDEX OF_NAME OF_FULLNAME OF_COMPATIBLE_N
|
||||||
|
[ -f "/sys/class/net/$1/uevent" ] && {
|
||||||
|
. "/sys/class/net/$1/uevent"
|
||||||
|
echo -n $DEVTYPE
|
||||||
|
}
|
||||||
|
}
|
||||||
resolve_lower_devices()
|
resolve_lower_devices()
|
||||||
{
|
{
|
||||||
# $1 - bridge interface name
|
# $1 - bridge interface name
|
||||||
|
@ -320,7 +320,7 @@ nft_fill_ifsets()
|
|||||||
# $5 - space separated wan physical interface names (optional)
|
# $5 - space separated wan physical interface names (optional)
|
||||||
# $6 - space separated wan6 physical interface names (optional)
|
# $6 - space separated wan6 physical interface names (optional)
|
||||||
|
|
||||||
local script i j ALLDEVS devs
|
local script i j ALLDEVS devs b
|
||||||
|
|
||||||
# if large sets exist nft works very ineffectively
|
# if large sets exist nft works very ineffectively
|
||||||
# looks like it analyzes the whole table blob to find required data pieces
|
# looks like it analyzes the whole table blob to find required data pieces
|
||||||
@ -348,15 +348,18 @@ flush set inet $ZAPRET_NFT_TABLE lanif"
|
|||||||
nft_create_or_update_flowtable 'offload' 2>/dev/null
|
nft_create_or_update_flowtable 'offload' 2>/dev/null
|
||||||
# then add elements. some of them can cause error because unsupported
|
# then add elements. some of them can cause error because unsupported
|
||||||
for i in $ALLDEVS; do
|
for i in $ALLDEVS; do
|
||||||
# first try to add interface itself
|
|
||||||
nft_create_or_update_flowtable 'offload' $i 2>/dev/null
|
|
||||||
# bridge members must be added instead of the bridge itself
|
# bridge members must be added instead of the bridge itself
|
||||||
# some members may not support hw offload. example : lan1 lan2 lan3 support, wlan0 wlan1 - not
|
# some members may not support hw offload. example : lan1 lan2 lan3 support, wlan0 wlan1 - not
|
||||||
|
b=
|
||||||
devs=$(resolve_lower_devices $i)
|
devs=$(resolve_lower_devices $i)
|
||||||
for j in $devs; do
|
for j in $devs; do
|
||||||
# do not display error if addition failed
|
# do not display error if addition failed
|
||||||
nft_create_or_update_flowtable 'offload' $j 2>/dev/null
|
nft_create_or_update_flowtable 'offload' $j && b=1 2>/dev/null
|
||||||
done
|
done
|
||||||
|
[ -n "$b" ] || {
|
||||||
|
# no lower devices added ? try to add interface itself
|
||||||
|
nft_create_or_update_flowtable 'offload' $i 2>/dev/null
|
||||||
|
}
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -2235,7 +2235,10 @@ static uint8_t dpi_desync_udp_packet_play(bool replay, size_t reasm_offset, uint
|
|||||||
{
|
{
|
||||||
struct desync_profile *dp_prev = dp;
|
struct desync_profile *dp_prev = dp;
|
||||||
|
|
||||||
dp = dp_find(¶ms.desync_profiles, IPPROTO_UDP, (struct sockaddr *)&dst, ctrack_replay ? ctrack_replay->hostname : host, ctrack_replay ? ctrack_replay->l7proto : l7proto, &bCheckDone, &bCheckResult, &bCheckExcluded);
|
dp = dp_find(¶ms.desync_profiles, IPPROTO_UDP, (struct sockaddr *)&dst,
|
||||||
|
ctrack_replay ? ctrack_replay->hostname : bHaveHost ? host : NULL,
|
||||||
|
ctrack_replay ? ctrack_replay->l7proto : l7proto,
|
||||||
|
&bCheckDone, &bCheckResult, &bCheckExcluded);
|
||||||
if (ctrack_replay)
|
if (ctrack_replay)
|
||||||
{
|
{
|
||||||
ctrack_replay->dp = dp;
|
ctrack_replay->dp = dp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user