From 6809f5d0dce46ad849049bdd03e8e65325a64327 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 11 Mar 2017 07:24:49 +0100 Subject: [PATCH] Find uid by source port and source address --- app/src/main/jni/netguard/ip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/jni/netguard/ip.c b/app/src/main/jni/netguard/ip.c index 6086c4d6..11339d45 100644 --- a/app/src/main/jni/netguard/ip.c +++ b/app/src/main/jni/netguard/ip.c @@ -450,10 +450,10 @@ jint get_uid(const int version, const int protocol, log_android(ANDROID_LOG_INFO, "%s/%u %d %s", source, port, u, line); } - if (port == sport) { + if (port == sport && + memcmp(version == 4 ? addr4 : addr6, saddr, version == 4 ? 4 : 16) == 0) { uid = u; - if (memcmp(version == 4 ? addr4 : addr6, saddr, version == 4 ? 4 : 16) == 0) - break; + break; } } else