Skip to content

Commit

Permalink
fix for moby#1333, calling LinkDel to delete link device when the err…
Browse files Browse the repository at this point in the history
… of LinkByName is NULL

Signed-off-by: ZhiPeng Lu <[email protected]>
  • Loading branch information
ZhiPeng Lu committed Feb 28, 2018
1 parent 8b1a0be commit 500e65e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/overlay/ov_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (d *driver) DeleteNetwork(nid string) error {

for _, ep := range n.endpoints {
if ep.ifName != "" {
if link, err := ns.NlHandle().LinkByName(ep.ifName); err != nil {
if link, err := ns.NlHandle().LinkByName(ep.ifName); err == nil {
ns.NlHandle().LinkDel(link)
}
}
Expand Down

0 comments on commit 500e65e

Please sign in to comment.