Browse Source

Merge pull request #1493 from Hintay/master

Fix panic if interfaces does not have any mac address
dcarns 2 years ago
parent
commit
a7ff340692
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netclient/functions/join.go

+ 1 - 1
netclient/functions/join.go

@@ -104,7 +104,7 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
 	// Find and set node MacAddress
 	// Find and set node MacAddress
 	if cfg.Node.MacAddress == "" {
 	if cfg.Node.MacAddress == "" {
 		macs, err := ncutils.GetMacAddr()
 		macs, err := ncutils.GetMacAddr()
-		if err != nil {
+		if err != nil || len(macs) == 0 {
 			//if macaddress can't be found set to random string
 			//if macaddress can't be found set to random string
 			cfg.Node.MacAddress = ncutils.MakeRandomString(18)
 			cfg.Node.MacAddress = ncutils.MakeRandomString(18)
 		} else {
 		} else {