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 <lu.zhipeng@zte.com.cn>
  • Loading branch information
ZhiPeng Lu committed Feb 28, 2018
1 parent a2e6eb2 commit b43aa94
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 b43aa94

Please sign in to comment.