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{}
}