diff --git a/link_linux.go b/link_linux.go index 60213bd..810fc4f 100644 --- a/link_linux.go +++ b/link_linux.go @@ -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) }