@@ -581,7 +581,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
581581 it.Family = unix.AF_INET6
582582 rules = append(rules, it)
583583 }*/
584- if p4 {
584+ if p4 && ! t . options . StrictRoute {
585585 it = netlink .NewRule ()
586586 it .Priority = priority
587587 it .IPProto = syscall .IPPROTO_ICMP
@@ -590,7 +590,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
590590 rules = append (rules , it )
591591 priority ++
592592 }
593- if p6 {
593+ if p6 && ! t . options . StrictRoute {
594594 it = netlink .NewRule ()
595595 it .Priority = priority6
596596 it .IPProto = syscall .IPPROTO_ICMPV6
@@ -599,26 +599,6 @@ func (t *NativeTun) rules() []*netlink.Rule {
599599 rules = append (rules , it )
600600 priority6 ++
601601 }
602- if p4 {
603- it = netlink .NewRule ()
604- it .Priority = priority
605- it .Invert = true
606- it .Dport = netlink .NewRulePortRange (53 , 53 )
607- it .Table = unix .RT_TABLE_MAIN
608- it .SuppressPrefixlen = 0
609- it .Family = unix .AF_INET
610- rules = append (rules , it )
611- }
612- if p6 {
613- it = netlink .NewRule ()
614- it .Priority = priority6
615- it .Invert = true
616- it .Dport = netlink .NewRulePortRange (53 , 53 )
617- it .Table = unix .RT_TABLE_MAIN
618- it .SuppressPrefixlen = 0
619- it .Family = unix .AF_INET6
620- rules = append (rules , it )
621- }
622602 }
623603
624604 if p4 {
0 commit comments