diff --git a/daemon/common/config/config.go b/daemon/common/config/config.go index cbba6bbd3273e018f8212a9851d09e251775954d..7b27aef264275c59d7ae82895cb65ce1840aceaa 100644 --- a/daemon/common/config/config.go +++ b/daemon/common/config/config.go @@ -78,7 +78,7 @@ var ( func init() { conf := new(KeentunedConf) if err := conf.Save(); err != nil { - fmt.Printf("init Keentuned conf err:%v\n", err) + fmt.Printf("%v init Keentuned conf: %v\n", utils.ColorString("red", "[ERROR]"), err) os.Exit(1) } @@ -164,3 +164,4 @@ func changeStringToSlice(ipString string) ([]string, error) { return validIPs, nil } + diff --git a/daemon/common/utils/utils.go b/daemon/common/utils/utils.go index ef25d75ac003a1ce1eeb1dfee9de3129fc6dce2f..c17d2b143d03f83cd56192857578e7e6fcc171ab 100644 --- a/daemon/common/utils/utils.go +++ b/daemon/common/utils/utils.go @@ -114,7 +114,7 @@ func CheckIPValidity(origin []string) ([]string, []string) { if pureValue == "localhost" || pureValue == "127.0.0.1" || pureValue == "::1" { localIP := "localhost" if !orgMap[localIP] { - valid = append(valid, pureValue) + valid = append(valid, localIP) orgMap[localIP] = true continue } @@ -217,3 +217,4 @@ func RemoveRepeated(s []string) []string { return result } +