mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Do not attempt serf query when not initialized
Sometimes, the vxlan kernel code may generate miss notifications for vxlan bound packets when serf is not initliazed. In such cases we should not try doing a query as it will create a panic. We should error out which will generate a log message. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
parent
15a70d92dc
commit
eef129c103
1 changed files with 4 additions and 0 deletions
|
@ -151,6 +151,10 @@ func (d *driver) processQuery(q *serf.Query) {
|
|||
}
|
||||
|
||||
func (d *driver) resolvePeer(nid string, peerIP net.IP) (net.HardwareAddr, net.IPMask, net.IP, error) {
|
||||
if d.serfInstance == nil {
|
||||
return nil, nil, nil, fmt.Errorf("could not resolve peer: serf instance not initialized")
|
||||
}
|
||||
|
||||
qPayload := fmt.Sprintf("%s %s", string(nid), peerIP.String())
|
||||
resp, err := d.serfInstance.Query("peerlookup", []byte(qPayload), nil)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue