diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-18 12:08:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 12:08:08 -0500 |
commit | 094665ac0cccc04c7797881ff2a27ff330e9a72e (patch) | |
tree | 5e858d21a6d9ad22049bb8188fa71727be14e523 /vendor/github.com/vishvananda/netlink/rule.go | |
parent | 0bbf8fa14035371cdc5bb04f5db51da8a8f94d48 (diff) | |
parent | 774271c38a8c3e96c7518b3c03de2f00e87138be (diff) | |
download | podman-094665ac0cccc04c7797881ff2a27ff330e9a72e.tar.gz podman-094665ac0cccc04c7797881ff2a27ff330e9a72e.tar.bz2 podman-094665ac0cccc04c7797881ff2a27ff330e9a72e.zip |
Merge pull request #12894 from Luap99/deps
upgrade all dependencies
Diffstat (limited to 'vendor/github.com/vishvananda/netlink/rule.go')
-rw-r--r-- | vendor/github.com/vishvananda/netlink/rule.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vendor/github.com/vishvananda/netlink/rule.go b/vendor/github.com/vishvananda/netlink/rule.go index 95f2facfb..9b7b0af49 100644 --- a/vendor/github.com/vishvananda/netlink/rule.go +++ b/vendor/github.com/vishvananda/netlink/rule.go @@ -28,7 +28,18 @@ type Rule struct { } 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. |