keiko233 建议 Clash Nyanpasu 保留局域网访问权限与新装默认值的控制

在尚未合并的配置归属 PR 中,keiko233 支持让 ipv6 可选择由配置管理,但建议 allow-lan 继续由应用强制控制。他认为该字段涉及主机监听暴露,若交给订阅或配置变换,可能绕过 system:write 与 profile:write 的权限划分。他还建议新装默认保持 unified-delay 和 tcp-concurrent 为 Managed(true)、ipv6 为 Managed(false),仅在用户主动选择“跟随配置”等选项后交出相应控制,并把修订 6 的迁移限于 ipv6。

作者原文

Thanks for the detailed write-up on the Windows TUN + ipv6hint leak (#2794) and for the thorough migration and test coverage! Making ipv6 a ManageableField<bool> makes a lot of sense and fits cleanly into the post-processing ownership pipeline.

Before merging, could we narrow the scope of this PR on two fronts?

  1. Keep allow-lan as a forced bool (do not hand it to profiles)
  • Host listener boundary: Like mixed-port, port, socks-port, external-controller, and secret (see #5720), allow-lan controls local network exposure on the host rather than proxy routing topology. Many third-party subscription templates ship with allow-lan: true out of the box; letting profiles own it risks silently exposing local proxy listeners on untrusted LANs or public Wi-Fi.
  • RPC privilege separation (system:write vs. profile:write): ClashAccessPatch (patch_runtime_access) intentionally isolates allow-lan and secret behind system:write (Admin), whereas Operator tokens only hold profile:write and settings:write (#6378). If allow-lan can be Unmanaged, any caller with profile:write (or a remote subscription refresh) can enable LAN exposure through a profile or transform, effectively bypassing ClashAccessPatch and system:write.
  1. Keep fresh-install defaults Managed (unified-delay: Managed(true), tcp-concurrent: Managed(true), ipv6: Managed(false))
  • Consistent with #5669 and #5889 (tun.auto-route), handing a guard field over to profiles should remain an explicit user opt-in ("Follow profile") rather than changing fresh-install behavior silently.
  • Defaulting unified-delay and tcp-concurrent to Unmanaged causes subscriptions that omit those keys to fall back to core defaults (false in mihomo), regressing out-of-the-box latency measurement and TCP concurrency. Likewise, keeping ipv6: Managed(false) by default avoids unexpected dual-stack routing regressions on environments with broken IPv6 connectivity until the user explicitly chooses "Follow profile" or "Always on".

Suggested path forward:

  • Scope ClashGuardOverrides / ClashOverridesSettings / ClashOverridesSettingsPatch changes to ipv6: ManageableField<bool> only (with Default kept as Managed(false)).
  • Narrow the revision 6 migration to ipv6 (e.g., clash_config/manageable_ipv6).
  • Revert the allow-lan (ClashAccessPatch, AllowLanSwitch / AllowLanSettings) and unified-delay / tcp-concurrent default changes.

cc @greenhat616