Skip to content
Permalink
Browse files

syz-ci: fix manager http addr

Manager http addr is usually just ":port".
Prepend "127.0.0.1" in such case.
  • Loading branch information...
dvyukov committed Sep 20, 2018
1 parent 2d41b5d commit 6cee973cb5514a9ab06a2d258dd4bc527004c23f
Showing with 7 additions and 2 deletions.
  1. +6 −2 syz-ci/manager.go
  2. +1 −0 syz-ci/syz-ci.go
@@ -115,7 +115,7 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{}) *Mana
}
managercfg.Name = cfg.Name + "-" + mgrcfg.Name
managercfg.Syzkaller = filepath.FromSlash("syzkaller/current")
if managercfg.HTTP == "" && cfg.ManagerPort != 0 {
if managercfg.HTTP == "" {
managercfg.HTTP = fmt.Sprintf(":%v", cfg.ManagerPort)
cfg.ManagerPort++
}
@@ -599,7 +599,11 @@ func (mgr *Manager) uploadCoverReport() error {
return fmt.Errorf("failed to create GCS client: %v", err)
}
defer GCS.Close()
resp, err := http.Get(fmt.Sprintf("http://%v/cover", mgr.managercfg.HTTP))
addr := mgr.managercfg.HTTP
if addr != "" && addr[0] == ':' {
addr = "127.0.0.1" + addr // in case addr is ":port"
}
resp, err := http.Get(fmt.Sprintf("http://%v/cover", addr))
if err != nil {
return fmt.Errorf("failed to get report: %v", err)
}
@@ -201,6 +201,7 @@ func loadConfig(filename string) (*Config, error) {
cfg := &Config{
SyzkallerRepo: "https://github.com/google/syzkaller.git",
SyzkallerBranch: "master",
ManagerPort: 10000,
Goroot: os.Getenv("GOROOT"),
}
if err := config.LoadFile(filename, cfg); err != nil {

0 comments on commit 6cee973

Please sign in to comment.
You can’t perform that action at this time.