derive routerName from networkConfig.Bridge.Interface()
This commit is contained in:
1 parent
e5c256daa1
commit
3a367595d7
1 file changed
+5
-4
+5
-4
@@ -65,7 +65,6 @@ func main() {
|
||||
peers []string
|
||||
noDNS bool
|
||||
dnsConfig dnsConfig
|
||||
iface *net.Interface
|
||||
datapathName string
|
||||
trustedSubnetStr string
|
||||
|
||||
@@ -141,11 +140,12 @@ func main() {
|
||||
networkConfig.Bridge = fastdp.Bridge()
|
||||
overlays.Add("fastdp", fastdp.Overlay())
|
||||
case ifaceName != "":
|
||||
var err error
|
||||
iface, err = weavenet.EnsureInterface(ifaceName)
|
||||
iface, err := weavenet.EnsureInterface(ifaceName)
|
||||
checkFatal(err)
|
||||
networkConfig.Bridge, err = weave.NewPcap(iface, bufSzMB*1024*1024) // bufsz flag is in MB
|
||||
checkFatal(err)
|
||||
default:
|
||||
networkConfig.Bridge = weave.NullBridge{}
|
||||
}
|
||||
sleeve := weave.NewSleeveOverlay(config.Port)
|
||||
overlays.Add("sleeve", sleeve)
|
||||
@@ -162,8 +162,9 @@ func main() {
|
||||
}
|
||||
|
||||
if routerName == "" {
|
||||
iface := networkConfig.Bridge.Interface()
|
||||
if iface == nil {
|
||||
Log.Fatal("Either an interface must be specified with --iface or a name with -name")
|
||||
Log.Fatal("Either an interface must be specified with --datapath or --iface, or a name with --name")
|
||||
}
|
||||
routerName = iface.HardwareAddr.String()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user