[X] 这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 This is an issue of the Mihomo core per se, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo.
Mihomo version
Mihomo Meta v1.18.0 linux arm64 with go1.21.5 Tue Jan 2 07:30:47 UTC 2024
func getOrigDst(oob []byte) (netip.AddrPort, error) {
// oob contains socket control messages which we need to parse.
scms, err := unix.ParseSocketControlMessage(oob)
if err != nil {
return netip.AddrPort{}, fmt.Errorf("parse control message: %w", err)
}
// retrieve the destination address from the SCM.
//----------------------------------------------------------------------
sa, err := unix.ParseOrigDstAddr(&scms[0]) // <- panic: runtime error: index out of range [0] with length 0
//----------------------------------------------------------------------
if err != nil {
return netip.AddrPort{}, fmt.Errorf("retrieve destination: %w", err)
}
// encode the destination address into a cmsg.
var rAddr netip.AddrPort
switch v := sa.(type) {
case *unix.SockaddrInet4:
rAddr = netip.AddrPortFrom(netip.AddrFrom4(v.Addr), uint16(v.Port))
case *unix.SockaddrInet6:
rAddr = netip.AddrPortFrom(netip.AddrFrom16(v.Addr), uint16(v.Port))
default:
return netip.AddrPort{}, fmt.Errorf("unsupported address type: %T", v)
}
return rAddr, nil
}
Verify steps
Mihomo version
Mihomo Meta v1.18.0 linux arm64 with go1.21.5 Tue Jan 2 07:30:47 UTC 2024
What OS are you seeing the problem on?
Linux
Mihomo config
Mihomo log
Description
系统
刚重装的树莓派官方镜像,仅运行了预装的服务和 docker 及 docker-compose 相关服务 仅 ipv6 & udp & tproxy 协议会出现此问题,不论是 ipv4 & udp & tproxy 还是 ipv6 & udp & http 或是 ipv6 & tcp & tproxy 都不会出现此问题 使用 arm64, armv7 版本,以及测试过 Openwrt,Arch Linux(amd64 版本),Docker 镜像,均会报出同样的错误
工作目录
运行方式
使用
sudo -u tproxy ./mihomo-linux-arm64 -d ./mihomo
运行其中 tproxy uid:gid 为 0:23333
代码报错位置
github.com/metacubex/mihomo/listener/tproxy/udp_linux.go
已开启 ipv6 转发
ipv6 相关规则、路由
auto_v6.sh
若还需其他信息,我将尽快提供
感谢!