mirror of https://github.com/M66B/NetGuard.git
Skip DNS TCP length
This commit is contained in:
parent
daabaab4ba
commit
467a74a464
|
@ -585,8 +585,10 @@ void check_tcp_socket(const struct arguments *args,
|
|||
s->tcp.received += bytes;
|
||||
|
||||
// Process DNS response
|
||||
if (ntohs(s->tcp.dest) == 53)
|
||||
parse_dns_response(args, s, buffer, (size_t *) &bytes);
|
||||
if (ntohs(s->tcp.dest) == 53 && bytes > 2) {
|
||||
ssize_t dlen = bytes - 2;
|
||||
parse_dns_response(args, s, buffer + 2, (size_t *) &dlen);
|
||||
}
|
||||
|
||||
// Forward to tun
|
||||
if (write_data(args, &s->tcp, buffer, (size_t) bytes) >= 0) {
|
||||
|
|
Loading…
Reference in New Issue