Skip to content

Commit

Permalink
Fix Remove bad suppress_prefixlength iproute2 rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed May 10, 2024
1 parent fb6e917 commit 3f128a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tun_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,26 @@ func (t *NativeTun) rules() []*netlink.Rule {
rules = append(rules, it)
priority6++
}
if p4 && !t.options.StrictRoute {
it = netlink.NewRule()
it.Priority = priority
it.Invert = true
it.Dport = netlink.NewRulePortRange(53, 53)
it.Table = unix.RT_TABLE_MAIN
it.SuppressPrefixlen = 0
it.Family = unix.AF_INET
rules = append(rules, it)
}
if p6 && !t.options.StrictRoute {
it = netlink.NewRule()
it.Priority = priority6
it.Invert = true
it.Dport = netlink.NewRulePortRange(53, 53)
it.Table = unix.RT_TABLE_MAIN
it.SuppressPrefixlen = 0
it.Family = unix.AF_INET6
rules = append(rules, it)
}
}

if p4 {
Expand Down

0 comments on commit 3f128a4

Please sign in to comment.