From 4eda7e361bbcafaa6e92a103709b94a5b243bdf8 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 29 Mar 2015 10:36:01 +0100 Subject: [PATCH] put back forwarder channel nil check since otherwise forward(...) can block indefinitely due to both the forwarder channel and finshed channel being nil --- router/forwarder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/router/forwarder.go b/router/forwarder.go index dfae4d4a..f1db363b 100644 --- a/router/forwarder.go +++ b/router/forwarder.go @@ -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