mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-20 00:31:17 -08:00
ClientPrepareNewFlowForMagicIP folded resolving a Magic IP and counting the flow into one call, and the datapath dropped its own IsValid check on the resolved Transit IP in favor of trusting the new ok return. That left the validity requirement stated only in the Conn25Datapath doc comment, and an implementation that violates it panics the packet path two different ways. A zero Transit IP is neither Is4 nor Is6, so it slips past both of checksum.UpdateDstAddr's family-mismatch panics and reaches As4, which panics in turn; a valid Transit IP in the other family hits one of those family-mismatch panics outright. Check for both, releasing the counted reference since no flow is installed, so the packet passes through unmodified as before. Updates https://github.com/tailscale/corp/issues/44273 Change-Id: Ib0c0eaa92bc4f0470299da08d48c865e1d101849 Signed-off-by: Mazdak Nasab <[email protected]>