Skip to content

Commit

Permalink
Only intercept DNS packets arriving at netif-ipaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Feb 1, 2019
1 parent a9d829e commit ba4c45d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tun2socks/tun2socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,9 @@ int process_device_udp_packet (uint8_t *data, int data_len)

// if transparent DNS is enabled, any packet arriving at out netif
// address to port 53 is considered a DNS packet
is_dns = (options.dnsgw && udp_header.dest_port == hton16(53));
is_dns = (options.dnsgw &&
ipv4_header.destination_address == netif_ipaddr.ipv4 &&
udp_header.dest_port == hton16(53));
} break;

case 6: {
Expand Down

0 comments on commit ba4c45d

Please sign in to comment.