Prechádzať zdrojové kódy

Don't let the server ID be 127.0.0.1

Ask Bjørn Hansen 7 rokov pred
rodič
commit
f1c6e92d5f
1 zmenil súbory, kde vykonal 9 pridanie a 5 odobranie
  1. 9 5
      util.go

+ 9 - 5
util.go

@@ -42,12 +42,16 @@ func getInterfaces() []string {
 
 		// default to the first interfaces
 		// todo: skip 127.0.0.1 and ::1 ?
-		if len(serverInfo.ID) == 0 {
-			serverInfo.ID = ip
-		}
-		if len(serverInfo.IP) == 0 {
-			serverInfo.IP = ip
+
+		if ip != "127.0.0.1" {
+			if len(serverInfo.ID) == 0 {
+				serverInfo.ID = ip
+			}
+			if len(serverInfo.IP) == 0 {
+				serverInfo.IP = ip
+			}
 		}
+
 		inter = append(inter, host)
 
 	}