This snippet in Elixir triggers a panic inside smoltcp:
{:ok, dev} = Tailscale.connect("my_state.json", auth_key: System.get_env("TS_RS_AUTHKEY"))
{:ok, sock} = Tailscale.Udp.bind(dev, :ip6, 1234)
Tailscale.Udp.send(udp, {1, 2, 3, 4}, 1234, "abc")
thread 'tokio-rt-worker' (22172) panicked at ...\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\smoltcp-0.13.0\src\wire\ip.rs:627:18:
IP version mismatch: src=Ipv6(fd7a:115c:a1e0::redacted) dst=Ipv4(1.2.3.4)
Expect the same thing happens anywhere we use sockets, since all the methods take an undifferentiated IpAddr — there's no difference at the type level between an IPv4 socket and and IPv6 one.
We should catch this mismatch in ts_netstack_smoltcp_core and return an error rather than allowing it to panic.
This snippet in Elixir triggers a panic inside smoltcp:
Expect the same thing happens anywhere we use sockets, since all the methods take an undifferentiated
IpAddr— there's no difference at the type level between an IPv4 socket and and IPv6 one.We should catch this mismatch in
ts_netstack_smoltcp_coreand return an error rather than allowing it to panic.