put back forwarder channel nil check

since otherwise forward(...) can block indefinitely due to both the
forwarder channel and finshed channel being nil
This commit is contained in:
Matthias Radestock committed 2015-03-29 10:36:01 +01:00
1 parent b6448fa196
commit 4eda7e361b
1 file changed
+4
+4
View File
@@ -87,6 +87,10 @@ func (conn *LocalConnection) Forward(df bool, frame *ForwardedFrame, dec *Ethern
)
conn.RUnlock()
if forwardChan == nil || forwardChanDF == nil {
conn.Log("Cannot forward frame yet - awaiting contact")
return nil
}
// We could use non-blocking channel sends here, i.e. drop frames
// on the floor when the forwarder is busy. This would allow our
// caller - the capturing loop in the router - to read frames more