Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed regression with dns server start condition #3137

Merged
merged 3 commits into from
Jun 9, 2017
Merged

Conversation

preetapan
Copy link
Contributor

Found by comparing sha hashes 10540f8 and b6c69eb

Fixes #3135

@@ -291,8 +291,10 @@ func (a *Agent) Start() error {
}

// start DNS servers
if err := a.listenAndServeDNS(); err != nil {
return err
if c.Ports.DNS > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better way to fix this is for config.DNSAddrs() to return an empty array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which it does for Ports.DNS == 0 but not <0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -790,7 +790,7 @@ func (p ProtoAddr) String() string {
}

func (c *Config) DNSAddrs() ([]ProtoAddr, error) {
if c.Ports.DNS == 0 {
if c.Ports.DNS < 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably use <=0 to keep parity with the HTTP implementation below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, previously the code checked for > 0 to enable. Inverting it is <= 0

@@ -790,7 +790,7 @@ func (p ProtoAddr) String() string {
}

func (c *Config) DNSAddrs() ([]ProtoAddr, error) {
if c.Ports.DNS == 0 {
if c.Ports.DNS <= 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now

@magiconair
Copy link
Contributor

LGTM. Can you squash merge this since only the last commit is relevant?

@slackpad slackpad merged commit 2de0321 into master Jun 9, 2017
@slackpad slackpad deleted the issue_3135 branch June 9, 2017 22:50
@slackpad
Copy link
Contributor

slackpad commented Jun 9, 2017

This looked good so I went ahead and merged + updated the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants