Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Fix Network Issue #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions nabla-lib/network/network_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -328,6 +322,15 @@ func CreateTapInterfaceDocker(tapName string, master string) (
return nil, nil, nil, "", err
}

// default-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
Expand Down