Fallback to source port match only while searching for connection

This commit is contained in:
M66B 2017-03-15 19:08:55 +01:00
parent 3f7d6f1dff
commit 7b81858459
1 changed files with 6 additions and 3 deletions

View File

@ -457,9 +457,12 @@ jint get_uid(const int version, const int protocol,
_sport, dest, _dport, u, line);
}
if (_sport == sport && _dport == dport &&
memcmp(version == 4 ? _daddr4 : _daddr6, daddr, version == 4 ? 4 : 16) ==
0) {
if (_sport == sport &&
(lasttry || (_dport == dport &&
memcmp(version == 4
? _daddr4
: _daddr6, daddr,
version == 4 ? 4 : 16) == 0))) {
uid = u;
break;
}