1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1097 from mrjana/resolver

Resolver sockets not flushed on default gw change
This commit is contained in:
Alessandro Boch 2016-04-10 11:00:17 -07:00
commit 0251123411
2 changed files with 8 additions and 0 deletions

View file

@ -477,6 +477,10 @@ func (ep *endpoint) sbJoin(sb *sandbox, options ...EndpointOption) error {
ep.Name(), ep.ID(), err)
}
}
if sb.resolver != nil {
sb.resolver.FlushExtServers()
}
}
if !sb.needDefaultGW() {

View file

@ -158,6 +158,10 @@ func (r *resolver) Start() error {
func (r *resolver) FlushExtServers() {
for i := 0; i < maxExtDNS; i++ {
if r.extDNSList[i].extConn != nil {
r.extDNSList[i].extConn.Close()
}
r.extDNSList[i].extConn = nil
r.extDNSList[i].extOnce = sync.Once{}
}