[bind10-dev] libdns and problem record and loadzone loading it

Evan Hunt each at isc.org
Thu Mar 11 03:28:28 UTC 2010


> What should libdns do? I don't think b10-auth should crash due to 
> accidently loaded data in the data source. Shouldn't return some FORMERR 
> or SERVFAIL other problem?

SERVFAIL seems appropriate.

This does the job, but should probably do more; if any data has been added
to the message sections before the exception was encountered, it should be
cleared.  I don't see an easy way to do that with the current Message API
however.

                                        eh

Index: auth_srv.cc
===================================================================
--- auth_srv.cc (revision 1317)
+++ auth_srv.cc (working copy)
@@ -150,8 +150,12 @@
     message.setDNSSECSupported(dnssec_ok);
     message.setUDPSize(4096);   // XXX: hardcoding
 
-    Query query(message, dnssec_ok);
-    impl_->data_sources_.doQuery(query);
+    try {
+        Query query(message, dnssec_ok);
+        impl_->data_sources_.doQuery(query);
+    } catch(...) {
+        message.setRcode(Rcode::SERVFAIL());
+    }
 
     response_renderer.setLengthLimit(udp_buffer ? remote_bufsize : 65535);
     message.toWire(response_renderer);




More information about the bind10-dev mailing list