Leadaxe:Hysteria2 经 MASQUE(WARP) 的 IPv6 链路失败源于包尺寸,给出 initial_packet_size/mtu 调整与内核修复

在 sing-box-lx issue #37(Hysteria2 经 MASQUE/IPv6 的 chain 代理不可用)中,Leadaxe 复现并定位为包尺寸问题、而非 dial 路径的 chain/detour bug:quic-go(hysteria2 使用)发送 1280 字节 UDP 载荷,IPv6 下整包为 1328 字节,超出 masque 隧道 1280 的 MTU,被用户态栈拆成 IPv6 分片后遭 WARP 丢弃;IPv4 分片可通过,故 IPv4 目标正常。在 mtu:1280 下实测 IPv6 UDP 载荷 1232 字节可通过,1240 及以上 3/3 丢失。当前两种修法:hysteria2 出站设 "initial_packet_size": 1232(推荐),或 masque 出站设 "mtu": 1340。内核已修复(commit c12c0632d,下个版本):隧道之上的节点会自动从隧道推导 initial_packet_size/mtu(lx.mtu_align,默认开启),masque 外层 QUIC 起始值改为 mtu+51(原 1242 会在每次隧道建立后数个 RTT 内丢失首个整包)。Leadaxe 同时提醒该 issue 明文包含其 WARP private_key,要求重新注册并删除该密钥。

作者原文

Reproduced and root-caused on a clean path (Amsterdam, WARP h3). This is not a chain/detour bug in the dial path — it is packet size.

quic-go (used by hysteria2) sends 1280-byte UDP payloads. Over IPv6 every full-size packet is 1328 bytes; that does not fit the masque tunnel's MTU of 1280, so the userspace stack splits it into IPv6 fragments, and WARP drops inner IPv6 fragments. IPv4 fragments pass, which is why the IPv4 target works. Measured through WARP at mtu: 1280: IPv6 UDP up to 1232 bytes of payload passes, 1240 and above is lost 3/3; QUIC Initial of 1252/1280 to IPv6 hosts times out, 1232 handshakes fine.

Either of these fixes it today, no core change needed:

  • on the hysteria2 outbound: "initial_packet_size": 1232 — fits any 1280-byte tunnel, recommended;
  • or on the masque outbound: "mtu": 1340 — WARP accepts inner packets of that size, but your outer path to WARP (IPv6 in your config) must then carry ~1440-byte packets without fragmentation.

Fixed in the core as well (commit c12c0632d, next release): nodes above an IP tunnel get initial_packet_size / mtu derived from the tunnel automatically (lx.mtu_align, default on) — your config as posted will log initial_packet_size → 1232 (detour warp-h3-ipv6[masque] mtu 1280 − 48 ipv6; pmtud off) at start. The masque outer QUIC also now starts at mtu + 51 instead of 1242, which was losing the first full-size packets for a few RTT after every tunnel bring-up.

⚠️ Your report contains your WARP private_key in clear text. Please regenerate the WARP registration and edit the key out of the issue.