refactor: tweak overlay & bridge initialisation sequence
for clarity
This commit is contained in:
1 parent
c3f2150b5b
commit
9933a4a368
1 file changed
+4
-8
+4
-8
@@ -139,10 +139,6 @@ func main() {
|
|||||||
networkConfig.Bridge = fastdp.Bridge()
|
networkConfig.Bridge = fastdp.Bridge()
|
||||||
overlays.Add("fastdp", fastdp.Overlay())
|
overlays.Add("fastdp", fastdp.Overlay())
|
||||||
}
|
}
|
||||||
sleeve := weave.NewSleeveOverlay(config.Port)
|
|
||||||
overlays.Add("sleeve", sleeve)
|
|
||||||
overlays.SetCompatOverlay(sleeve)
|
|
||||||
|
|
||||||
if ifaceName != "" {
|
if ifaceName != "" {
|
||||||
// -iface can coexist with -datapath, because
|
// -iface can coexist with -datapath, because
|
||||||
// pcap-based packet capture is a bit more efficient
|
// pcap-based packet capture is a bit more efficient
|
||||||
@@ -152,16 +148,16 @@ func main() {
|
|||||||
var err error
|
var err error
|
||||||
iface, err = weavenet.EnsureInterface(ifaceName)
|
iface, err = weavenet.EnsureInterface(ifaceName)
|
||||||
checkFatal(err)
|
checkFatal(err)
|
||||||
|
networkConfig.Bridge, err = weave.NewPcap(iface, bufSzMB*1024*1024) // bufsz flag is in MB
|
||||||
// bufsz flag is in MB
|
|
||||||
networkConfig.Bridge, err = weave.NewPcap(iface, bufSzMB*1024*1024)
|
|
||||||
checkFatal(err)
|
checkFatal(err)
|
||||||
}
|
}
|
||||||
|
sleeve := weave.NewSleeveOverlay(config.Port)
|
||||||
|
overlays.Add("sleeve", sleeve)
|
||||||
|
overlays.SetCompatOverlay(sleeve)
|
||||||
|
|
||||||
if password == "" {
|
if password == "" {
|
||||||
password = os.Getenv("WEAVE_PASSWORD")
|
password = os.Getenv("WEAVE_PASSWORD")
|
||||||
}
|
}
|
||||||
|
|
||||||
if password == "" {
|
if password == "" {
|
||||||
Log.Println("Communication between peers is unencrypted.")
|
Log.Println("Communication between peers is unencrypted.")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user