From a88e39d8067e7a203be8c7f724b069e3928a2419 Mon Sep 17 00:00:00 2001 From: Hubert Krauze Date: Wed, 9 Dec 2015 12:25:52 +0100 Subject: [PATCH] Check if master Bridge exists when LinkSetMaster --- link_linux.go | 3 +++ 1 file changed, 3 insertions(+) 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) }