Handle the case where Forward returns nil

Forward can return nil if the remote peer has HasShortID false.  That
can happen if we learn about a 1.2 peer from a 1.1  peer and attempt to
connect to it.

This change just fixes the panic.  HasShortID will never be set, so we'll
fall back to sleeve.  But if that occurs, if can be fixed by a restart of
the affected routers.
This commit is contained in:
David Wragg committed 2015-11-10 23:17:01 +00:00
1 parent 472ed5a7d3
commit 7dc1b50d3b
1 file changed
+4 -1
+4 -1
View File
@@ -674,7 +674,10 @@ func (fwd *fastDatapathForwarder) sendHeartbeat() {
DstPeer: fwd.remotePeer,
}
fwd.lock.RUnlock()
fwd.Forward(pk).Process(buf, dec, false)
if fop := fwd.Forward(pk); fop != nil {
fop.Process(buf, dec, false)
}
}
const (