From a16dbc02129638c5547d3edbf9aa441c3c43bba7 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Tue, 10 Oct 2017 18:11:21 -0700 Subject: [PATCH] Adds check to make sure port is given so we avoid a nil bind address. --- agent/config/builder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/config/builder.go b/agent/config/builder.go index 890074282..9698d0a6e 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -399,6 +399,9 @@ func (b *Builder) Build() (rt RuntimeConfig, err error) { for _, s := range c.Segments { name := b.stringVal(s.Name) port := b.portVal(fmt.Sprintf("segments[%s].port", name), s.Port) + if port == 0 { + return RuntimeConfig{}, fmt.Errorf("Port must be specified for segment %q", s.Name) + } bind := b.makeTCPAddr( b.expandFirstIP(fmt.Sprintf("segments[%s].bind", name), s.Bind),