fix: tun and tproxy+zapret regressions

This commit is contained in:
FUFSoB committed 2026-09-27 13:34:24 +05:00
1 parent d5e926b034
commit 845291ee49
7 files changed
+33

No files matched your search

@@ -75,6 +75,9 @@ let
}}
${nft} -f ${perAppTunChainFile}
${perAppTunWaitForInterface}
# The backend may not have brought the link up yet, and routes via a down link fail
# with "Device for nexthop is not up".
${ip} link set dev ${lib.escapeShellArg perAppRoutingTun.interface} up
tun_addr="''${tun_cidr%%/*}"
tun_route_prefix="$(cidr_network "$tun_cidr")"
${ip} -4 addr replace "$tun_cidr" dev ${lib.escapeShellArg perAppRoutingTun.interface}
@@ -109,6 +109,9 @@ in
${deleteXrayTunReplyTable}
${nft} -f ${xrayTunReplyRules}
# XRay may not have brought the link up yet, and routes via a down link fail with
# "Device for nexthop is not up".
${ip} link set dev ${lib.escapeShellArg globalTun.interface} up
tun_addr="''${tun_cidr%%/*}"
tun_route_prefix="$(cidr_network "$tun_cidr")"
+5
View File
@@ -21,6 +21,11 @@ in
tunInterfaces = lib.unique (
lib.optional (cfg.proxy.enable && cfg.proxy.tun.enable) cfg.proxy.tun.interface
++ lib.optional (cfg.proxy.enable && cfg.perAppRouting.tun.enable) cfg.perAppRouting.tun.interface
# TProxy reroutes local apps' packets out lo to the backend's listener; desync there
# corrupts the handshake the backend reads, like on a TUN.
++ lib.optional (
cfg.proxy.enable && (cfg.proxy.tproxy.enable || cfg.perAppRouting.tproxy.enable)
) "lo"
);
# The transparent backends steer the same packets; a per-app zapret instance replaces them.