Add AlwaysAllowOutbound to session firewall

This commit is contained in:
Neil Alexander 2018-10-08 19:51:51 +01:00
parent 3f237372c9
commit 3ed63ede1e
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 31 additions and 9 deletions

View file

@ -184,6 +184,10 @@ func (s *searches) checkDHTRes(info *searchInfo, res *dhtRes) bool {
sinfo, isIn := s.core.sessions.getByTheirPerm(&res.Key)
if !isIn {
sinfo = s.core.sessions.createSession(&res.Key)
if sinfo == nil {
// nil if the DHT search finished but the session wasn't allowed
return true
}
_, isIn := s.core.sessions.getByTheirPerm(&res.Key)
if !isIn {
panic("This should never happen")