diff options
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r-- | src/anytun.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index a235786..d8f2159 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -161,16 +161,24 @@ void sender(void* p) if(param->cl.empty()) continue; //std::cout << "got Packet for plain "<<plain_packet.getDstAddr().toString(); + ConnectionMap::iterator cit; #ifndef NOROUTING - mux = gRoutingTable.getRoute(plain_packet.getDstAddr()); - //std::cout << " -> "<<mux << std::endl; - ConnectionMap::iterator cit = param->cl.getConnection(mux); + try + { + mux = gRoutingTable.getRoute(plain_packet.getDstAddr()); + //std::cout << " -> "<<mux << std::endl; + cit = param->cl.getConnection(mux); + } + catch (std::exception& e) + { + continue; // no route + } #else - ConnectionMap::iterator cit = param->cl.getBegin(); + cit = param->cl.getBegin(); #endif if(cit==param->cl.getEnd()) - continue; + continue; //no connection ConnectionParam & conn = cit->second; if(conn.remote_end_ == emptyEndpoint) |