Remove listen check

This commit is contained in:
Asim Aslam 2019-08-10 18:44:50 +01:00
parent 2c66e94045
commit 6dd3ea1853

View File

@ -128,6 +128,7 @@ func (t *tun) process() {
// send the message via the interface // send the message via the interface
t.RLock() t.RLock()
log.Debugf("Sending some shit %d links", len(t.links))
for _, link := range t.links { for _, link := range t.links {
log.Debugf("Sending %+v to %s", newMsg, link.Remote()) log.Debugf("Sending %+v to %s", newMsg, link.Remote())
link.Send(newMsg) link.Send(newMsg)
@ -172,11 +173,6 @@ func (t *tun) listen(link transport.Socket, listener bool) {
var exists bool var exists bool
log.Debugf("Received %+v from %s", msg, link.Remote()) log.Debugf("Received %+v from %s", msg, link.Remote())
// if its a local listener then we use that as the session id
// e.g we're using a loopback connecting to ourselves
if listener {
s, exists = t.getSocket(id, "listener")
} else {
// get the socket based on the tunnel id and session // get the socket based on the tunnel id and session
// this could be something we dialed in which case // this could be something we dialed in which case
// we have a session for it otherwise its a listener // we have a session for it otherwise its a listener
@ -187,7 +183,6 @@ func (t *tun) listen(link transport.Socket, listener bool) {
// has no session but its set a listener session // has no session but its set a listener session
s, exists = t.getSocket(id, "listener") s, exists = t.getSocket(id, "listener")
} }
}
// no socket in existence // no socket in existence
if !exists { if !exists {