gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25896 - gnunet/src/dns


From: gnunet
Subject: [GNUnet-SVN] r25896 - gnunet/src/dns
Date: Fri, 25 Jan 2013 14:03:09 +0100

Author: grothoff
Date: 2013-01-25 14:03:08 +0100 (Fri, 25 Jan 2013)
New Revision: 25896

Modified:
   gnunet/src/dns/gnunet-service-dns.c
Log:
-check that this is actually a DNS packet

Modified: gnunet/src/dns/gnunet-service-dns.c
===================================================================
--- gnunet/src/dns/gnunet-service-dns.c 2013-01-25 12:11:58 UTC (rev 25895)
+++ gnunet/src/dns/gnunet-service-dns.c 2013-01-25 13:03:08 UTC (rev 25896)
@@ -50,7 +50,12 @@
 #include "gnunet_statistics_service.h"
 #include "gnunet_tun_lib.h"
 
+/**
+ * Port number for DNS
+ */
+#define DNS_PORT 53
 
+
 /**
  * Generic logging shorthand
  */
@@ -1066,7 +1071,8 @@
                ntohs (tun->proto));
     return GNUNET_OK;
   }
-  if (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct 
GNUNET_TUN_DnsHeader))
+  if ( (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct 
GNUNET_TUN_DnsHeader)) ||
+       (DNS_PORT != ntohs (udp->destination_port)) )
   {    
     /* non-DNS packet received on TUN, ignore */
     GNUNET_STATISTICS_update (stats,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]