Native improved log logic

This commit is contained in:
M66B 2016-01-27 13:50:58 +01:00
parent a8216a5e1f
commit 9b933ecb0e
1 changed files with 13 additions and 10 deletions

View File

@ -1082,14 +1082,17 @@ void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t le
#endif
// Check if allowed
jboolean allowed = (jboolean) !syn;
if (syn && args->filter) {
jboolean allowed = 0;
if (args->filter) {
allowed = (jboolean) !syn;
if (syn) {
for (int i = 0; i < args->ucount; i++)
if (uid == args->uids[i]) {
allowed = 1;
break;
}
}
}
// Handle allowed traffic
int log = 0;
@ -1112,9 +1115,9 @@ void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t le
log = 1;
// Log traffic
if (args->log && (!args->filter || log))
log_packet(args, version, protocol, flags, source, sport, dest, dport, 1, extra, uid,
allowed);
if (args->log && log)
log_packet(args, version, protocol, flags,
source, sport, dest, dport, 1, extra, uid, allowed);
}
jboolean handle_udp(const struct arguments *args,