Skip to content

Prevent DNS server conflicts in CreateBridgeIface#1577

Merged
creack merged 1 commit intomoby:masterfrom
jadeallenx:fix/1502
Nov 6, 2013
Merged

Prevent DNS server conflicts in CreateBridgeIface#1577
creack merged 1 commit intomoby:masterfrom
jadeallenx:fix/1502

Conversation

@jadeallenx
Copy link
Copy Markdown

Fixes #1502

  • Read /etc/resolv.conf and extract listed nameservers. Format them as CIDR blocks ("1.2.3.4/32")
  • Check for conflicts when generating a bridge network block
  • Add tests to cover extensions in utils and network

@crosbymichael
Copy link
Copy Markdown
Contributor

@mrallen1 You should run go fmt -w -s over the code to format the changes.

@jadeallenx
Copy link
Copy Markdown
Author

I'd really like to fix this problem. If you have suggestions for the implementation, I'd be happy to rework my PR.

Thanks.

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Sep 13, 2013

Ping @creack @vieux @crosbymichael

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Sep 13, 2013

This looks useful and I don't see any obvious problems. Any risks of false positives that you're aware of?

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Oct 30, 2013

We should really merge this. I apologize @mrallen1 for the delay. We are slowly but surely catching up on our backlog.

/cc @vieux @crosbymichael.

@mrallen1 want to give a shot at rebasing? We didn't change the network code much, so it should be easy.

Thanks

@jadeallenx
Copy link
Copy Markdown
Author

Sure.

@jadeallenx
Copy link
Copy Markdown
Author

OK, rebase is finally finished. Switched the code to use the StripComments function and pull the nameserver IP from a regular expression which is a nice improvement over the original code.

All tests pass.

Please review @crosbymichael @shykes @vieux

Thank you.

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Nov 5, 2013

LGTM, ping @crosbymichael @creack

@creack
Copy link
Copy Markdown
Contributor

creack commented Nov 5, 2013

@mrallen1 could you squash your PR?

@jadeallenx
Copy link
Copy Markdown
Author

Sure. I will do it tonight after work.

Retrieve /etc/resolv.conf data (if available)

Add checkNameserverOverlaps and call it to
make sure there are no conflicts

Add utils.GetNameserversAsCIDR and tests

Read /etc/resolv.conf and pull out nameservers,
formatting them as a CIDR block ("1.2.3.4/32")
@jadeallenx
Copy link
Copy Markdown
Author

Commits squashed - ping @creack

@creack
Copy link
Copy Markdown
Contributor

creack commented Nov 6, 2013

LGTM

creack added a commit that referenced this pull request Nov 6, 2013
Prevent DNS server conflicts in CreateBridgeIface
@creack creack merged commit c22ff02 into moby:master Nov 6, 2013
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.

DNS failure when running Docker in Docker on a Vagrant VM

5 participants