diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-01-25 13:03:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-01-25 13:03:08 +0000 |
commit | 8ab3f5bf4b9335429a06752b18de80698883321d (patch) | |
tree | 3493677bc94c555bdb7d2e26b5b44351eac7ea10 /src/dns | |
parent | b67d0aa2e982ad992ef0ccd80146d38e05258cc7 (diff) | |
download | gnunet-8ab3f5bf4b9335429a06752b18de80698883321d.tar.gz gnunet-8ab3f5bf4b9335429a06752b18de80698883321d.zip |
-check that this is actually a DNS packet
Diffstat (limited to 'src/dns')
-rw-r--r-- | src/dns/gnunet-service-dns.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index 5db14c56a..19c9d8eea 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -50,6 +50,11 @@ | |||
50 | #include "gnunet_statistics_service.h" | 50 | #include "gnunet_statistics_service.h" |
51 | #include "gnunet_tun_lib.h" | 51 | #include "gnunet_tun_lib.h" |
52 | 52 | ||
53 | /** | ||
54 | * Port number for DNS | ||
55 | */ | ||
56 | #define DNS_PORT 53 | ||
57 | |||
53 | 58 | ||
54 | /** | 59 | /** |
55 | * Generic logging shorthand | 60 | * Generic logging shorthand |
@@ -1066,7 +1071,8 @@ process_helper_messages (void *cls GNUNET_UNUSED, void *client, | |||
1066 | ntohs (tun->proto)); | 1071 | ntohs (tun->proto)); |
1067 | return GNUNET_OK; | 1072 | return GNUNET_OK; |
1068 | } | 1073 | } |
1069 | if (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct GNUNET_TUN_DnsHeader)) | 1074 | if ( (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct GNUNET_TUN_DnsHeader)) || |
1075 | (DNS_PORT != ntohs (udp->destination_port)) ) | ||
1070 | { | 1076 | { |
1071 | /* non-DNS packet received on TUN, ignore */ | 1077 | /* non-DNS packet received on TUN, ignore */ |
1072 | GNUNET_STATISTICS_update (stats, | 1078 | GNUNET_STATISTICS_update (stats, |