mirror of https://github.com/M66B/NetGuard.git
Native reduce UDP logging
This commit is contained in:
parent
cb913954ce
commit
1783363e61
|
@ -1019,8 +1019,9 @@ void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t le
|
||||||
|
|
||||||
// Get uid
|
// Get uid
|
||||||
jint uid = -1;
|
jint uid = -1;
|
||||||
if ((protocol == IPPROTO_TCP && syn) || protocol == IPPROTO_UDP) {
|
if (syn || (protocol == IPPROTO_UDP && dport != 53)) {
|
||||||
log_android(ANDROID_LOG_INFO, "get uid %s/%u syn %d", dest, dport, syn);
|
log_android(ANDROID_LOG_INFO, "get uid %s/%u version %d protocol %d syn %d",
|
||||||
|
dest, dport, version, protocol, syn);
|
||||||
int tries = 0;
|
int tries = 0;
|
||||||
usleep(1000 * UID_DELAY);
|
usleep(1000 * UID_DELAY);
|
||||||
while (uid < 0 && tries++ < UID_MAXTRY) {
|
while (uid < 0 && tries++ < UID_MAXTRY) {
|
||||||
|
@ -1064,7 +1065,8 @@ void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t le
|
||||||
|
|
||||||
// Check if allowed
|
// Check if allowed
|
||||||
jboolean allowed = 1;
|
jboolean allowed = 1;
|
||||||
if (protocol != IPPROTO_TCP || syn) {
|
if (syn || (protocol == IPPROTO_UDP && dport != 53) ||
|
||||||
|
!(protocol == IPPROTO_TCP || protocol == IPPROTO_UDP)) {
|
||||||
jobject objPacket = create_packet(args, version, protocol, flags,
|
jobject objPacket = create_packet(args, version, protocol, flags,
|
||||||
source, sport, dest, dport, 1, "", uid, 0);
|
source, sport, dest, dport, 1, "", uid, 0);
|
||||||
allowed = is_address_allowed(args, objPacket);
|
allowed = is_address_allowed(args, objPacket);
|
||||||
|
|
Loading…
Reference in New Issue