]> granicus.if.org Git - pdns/commitdiff
prevent us dying on emitting error message about unexpected packet
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 19 Feb 2016 20:09:53 +0000 (21:09 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 19 Feb 2016 20:09:53 +0000 (21:09 +0100)
pdns/pdns_recursor.cc

index 3738ac44a7b28db599b80119b851797f31f27dd6..43eacc87506ea8e4eb1143d46bebf87995d29b69 100644 (file)
@@ -1969,7 +1969,7 @@ retryWithName:
     }
     g_stats.unexpectedCount++; // if we made it here, it really is an unexpected answer
     if(g_logCommonErrors) {
-      L<<Logger::Warning<<"Discarding unexpected packet from "<<fromaddr.toStringWithPort()<<": "<<pident.domain<<", "<<pident.type<<", "<<MT->d_waiters.size()<<" waiters"<<endl;
+      L<<Logger::Warning<<"Discarding unexpected packet from "<<fromaddr.toStringWithPort()<<": "<< (pident.domain.empty() ? "<empty>" : pident.domain.toString())<<", "<<pident.type<<", "<<MT->d_waiters.size()<<" waiters"<<endl;
     }
   }
   else if(fd >= 0) {