From 77b5616082389f31eb5197a562dd2adfab4285b9 Mon Sep 17 00:00:00 2001 From: Lennart Stich Date: Tue, 28 Jul 2020 18:12:43 +0200 Subject: [PATCH 1/2] networking issue fixed --- nabla-lib/network/network_linux.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nabla-lib/network/network_linux.go b/nabla-lib/network/network_linux.go index aabecc9..42eda2e 100644 --- a/nabla-lib/network/network_linux.go +++ b/nabla-lib/network/network_linux.go @@ -287,7 +287,7 @@ func CreateTapInterfaceDocker(tapName string, master string) ( return nil, nil, nil, "", fmt.Errorf("no master interface: %v", err) } - masterAddr, masterIP, masterMask, gwAddr, mac, err := getMasterDetails(masterLink) + _, masterIP, masterMask, gwAddr, mac, err := getMasterDetails(masterLink) if err != nil { return nil, nil, nil, "", err } @@ -312,12 +312,6 @@ func CreateTapInterfaceDocker(tapName string, master string) ( return nil, nil, nil, "", err } - // ip addr del $INET_STR dev master - err = netlink.AddrDel(masterLink, masterAddr) - if err != nil { - return nil, nil, nil, "", err - } - genmac, err := net.ParseMAC("aa:aa:aa:aa:bb:cc") if err != nil { return nil, nil, nil, "", err @@ -328,6 +322,15 @@ func CreateTapInterfaceDocker(tapName string, master string) ( return nil, nil, nil, "", err } + // defaukt-br0 has to be removed first if exists + br, err := netlink.LinkByName("br0") + if br != nil { + err := netlink.LinkDel(br) + if err != nil { + return nil, nil, nil, "", err + } + } + br0, err := CreateBridge("br0") if err != nil { return nil, nil, nil, "", err From 9d7c59ddcadc95018aba74cc97b9d2378a7ef4bf Mon Sep 17 00:00:00 2001 From: Lennart Stich Date: Tue, 28 Jul 2020 21:08:50 +0200 Subject: [PATCH 2/2] typo --- nabla-lib/network/network_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nabla-lib/network/network_linux.go b/nabla-lib/network/network_linux.go index 42eda2e..a00fa25 100644 --- a/nabla-lib/network/network_linux.go +++ b/nabla-lib/network/network_linux.go @@ -322,7 +322,7 @@ func CreateTapInterfaceDocker(tapName string, master string) ( return nil, nil, nil, "", err } - // defaukt-br0 has to be removed first if exists + // default-br0 has to be removed first if exists br, err := netlink.LinkByName("br0") if br != nil { err := netlink.LinkDel(br)