Remove bad suppress_prefixlength iproute2 rule
This change gives tun priority over DHCP 121 rules
This commit is contained in:
parent
5584917e52
commit
e272ff0ad3
1 changed files with 2 additions and 22 deletions
24
tun_linux.go
24
tun_linux.go
|
|
@ -581,7 +581,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
|
||||||
it.Family = unix.AF_INET6
|
it.Family = unix.AF_INET6
|
||||||
rules = append(rules, it)
|
rules = append(rules, it)
|
||||||
}*/
|
}*/
|
||||||
if p4 {
|
if p4 && !t.options.StrictRoute {
|
||||||
it = netlink.NewRule()
|
it = netlink.NewRule()
|
||||||
it.Priority = priority
|
it.Priority = priority
|
||||||
it.IPProto = syscall.IPPROTO_ICMP
|
it.IPProto = syscall.IPPROTO_ICMP
|
||||||
|
|
@ -590,7 +590,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
|
||||||
rules = append(rules, it)
|
rules = append(rules, it)
|
||||||
priority++
|
priority++
|
||||||
}
|
}
|
||||||
if p6 {
|
if p6 && !t.options.StrictRoute {
|
||||||
it = netlink.NewRule()
|
it = netlink.NewRule()
|
||||||
it.Priority = priority6
|
it.Priority = priority6
|
||||||
it.IPProto = syscall.IPPROTO_ICMPV6
|
it.IPProto = syscall.IPPROTO_ICMPV6
|
||||||
|
|
@ -599,26 +599,6 @@ func (t *NativeTun) rules() []*netlink.Rule {
|
||||||
rules = append(rules, it)
|
rules = append(rules, it)
|
||||||
priority6++
|
priority6++
|
||||||
}
|
}
|
||||||
if p4 {
|
|
||||||
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 {
|
|
||||||
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 {
|
if p4 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue