From 54cf6f3ecce8d5bcbc734ef25f1ce81ffa9c80b9 Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Tue, 5 Aug 2008 18:51:24 +0000 Subject: [PATCH] implement some EDNS0 sanity checks git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1252 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/dnspacket.cc | 2 +- pdns/pdns_recursor.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index e59d6895a..e8ef9411e 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -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 >::const_iterator iter = edo.d_options.begin(); iter != edo.d_options.end(); diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 2fb4ef2ac..fa11c5b9d 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -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 ret; -- 2.49.0