]> granicus.if.org Git - pdns/commitdiff
implement some EDNS0 sanity checks
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 5 Aug 2008 18:51:24 +0000 (18:51 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 5 Aug 2008 18:51:24 +0000 (18:51 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1252 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dnspacket.cc
pdns/pdns_recursor.cc

index e59d6895a20a2a2ba0f5a2bf5d975a4d8bd4feb4..e8ef9411e5ea4211c09271c4367c86189df3ec18 100644 (file)
@@ -442,7 +442,7 @@ try
   d_ednsping.clear();
 
   if(getEDNSOpts(mdp, &edo)) {
-    d_maxreplylen=edo.d_packetsize;
+    d_maxreplylen=max(edo.d_packetsize, (uint16_t)1280);
 
     for(vector<pair<uint16_t, string> >::const_iterator iter = edo.d_options.begin();
        iter != edo.d_options.end(); 
index 2fb4ef2ac466b6fdcb5b5465f0c458d43ee3fda2..fa11c5b9dbfb48420fdb7ab13da6910d5f42237b 100644 (file)
@@ -513,7 +513,7 @@ void startDoResolve(void *p)
     uint16_t maxudpsize=512;
     EDNSOpts edo;
     if(getEDNSOpts(dc->d_mdp, &edo)) {
-      maxudpsize=edo.d_packetsize;
+      maxudpsize=max(edo.d_packetsize, (uint16_t)1280);
     }
     
     vector<DNSResourceRecord> ret;