Update github.com/vishvananda/netlink to v1.2.0-beta

Latest version fixes a segfault when used on some ppp setup

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
This commit is contained in:
Dominique Martinet
2022-04-26 11:36:30 +09:00
parent 0c39335765
commit f891722833
40 changed files with 2155 additions and 332 deletions

View File

@ -25,10 +25,22 @@ type Rule struct {
Invert bool
Dport *RulePortRange
Sport *RulePortRange
IPProto int
}
func (r Rule) String() string {
return fmt.Sprintf("ip rule %d: from %s table %d", r.Priority, r.Src, r.Table)
from := "all"
if r.Src != nil && r.Src.String() != "<nil>" {
from = r.Src.String()
}
to := "all"
if r.Dst != nil && r.Dst.String() != "<nil>" {
to = r.Dst.String()
}
return fmt.Sprintf("ip rule %d: from %s to %s table %d",
r.Priority, from, to, r.Table)
}
// NewRule return empty rules.