git://git.halfball.org
/
plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f98c94
)
pkg/ip: don't return error from DelLinkByNameAddr() if no addresses exist
author
Dan Williams
<dcbw@redhat.com>
Tue, 7 Nov 2017 22:07:04 +0000
(16:07 -0600)
committer
Dan Williams
<dcbw@redhat.com>
Tue, 7 Nov 2017 22:07:04 +0000
(16:07 -0600)
For some reason no addresses on the interface returned an error, despite
having a testcase that explicitly tested for success.
pkg/ip/link.go
patch
|
blob
|
history
diff --git
a/pkg/ip/link.go
b/pkg/ip/link.go
index
3cb8486
..
843ce8a
100644
(file)
--- a/
pkg/ip/link.go
+++ b/
pkg/ip/link.go
@@
-182,7
+182,7
@@
func DelLinkByNameAddr(ifName string) ([]*net.IPNet, error) {
}
addrs, err := netlink.AddrList(iface, netlink.FAMILY_ALL)
- if err != nil
|| len(addrs) == 0
{
+ if err != nil {
return nil, fmt.Errorf("failed to get IP addresses for %q: %v", ifName, err)
}