mirror of
https://github.com/vishvananda/netlink
synced 2024-12-18 21:04:56 +00:00
Check if master Bridge exists when LinkSetMaster
This commit is contained in:
parent
2f58676854
commit
a88e39d806
@ -133,6 +133,9 @@ func LinkSetMaster(link Link, master *Bridge) error {
|
||||
ensureIndex(masterBase)
|
||||
index = masterBase.Index
|
||||
}
|
||||
if index <= 0 {
|
||||
return fmt.Errorf("Device does not exist")
|
||||
}
|
||||
return LinkSetMasterByIndex(link, index)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user