MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
15.43k stars 2.56k forks source link

[Bug] tun模式下auto-route为false时仍会添加ipv6路由和规则 #1239

Open Yuanandcircle opened 4 months ago

Yuanandcircle commented 4 months ago

Verify steps

Operating System

Linux

System Version

OpenWrt 23.05.3

Mihomo Version

v1.18.4

Configuration File

tun:
  enable: true
  stack: system
  auto-route: false
  auto-detect-interface: false

Description

TUN模式下,设置auto-route为false时,mihomo仍会添加ipv6路由和规则。

root@openwrt:~# ip -6 rule
0:      from all lookup local
32765:  from all lookup 2022
32766:  from all lookup main

root@openwrt:~# ip -6 route
default dev utun  metric 1024

Reproduction Steps

Linux下开启tun模式即可复现

Logs

No response

dyhkwong commented 4 months ago

该行为来自 https://github.com/SagerNet/sing-tun/blob/fb6e917a2cd7a5e6a0c45cc5291f2cbe9c8e8bcb/tun_rules.go#L106-L179 ,似乎是为了避免有 Inet6Address 但没有 ipv6 路由时,ipv6 绕过 tun 直连发出。

nekohasekai commented 1 month ago

应该是写错了