]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove isValid
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 11 Jan 2024 09:04:39 +0000 (10:04 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 11 Jan 2024 10:57:41 +0000 (11:57 +0100)
pdns/dnsproxy.cc
pdns/iputils.hh

index d3b8e03e15fb0005a24cd6f24f3b722c431d742a..6482b67cf12bf361975302562c00c08a86e54524 100644 (file)
@@ -268,12 +268,10 @@ void DNSProxy::mainloop()
         memset(&msgh, 0, sizeof(struct msghdr));
         string reply; // needs to be alive at time of sendmsg!
         MOADNSParser mdp(false, p.getString());
-        if (p.d_eso.scope.isValid()){
-          // update the EDNS options with info from the resolver - issue #5469
-          // note that this relies on the ECS string encoder to use the source network, and only take the prefix length from scope
-          i->second.complete->d_eso.scope = p.d_eso.scope;
-          DLOG(g_log<<"from dnsproxy::mainLoop: updated EDNS options from resolver EDNS source: "<<i->second.complete->d_eso.source.toString()<<" EDNS scope: "<<i->second.complete->d_eso.scope.toString()<<endl);
-        }
+        // update the EDNS options with info from the resolver - issue #5469
+        // note that this relies on the ECS string encoder to use the source network, and only take the prefix length from scope
+        i->second.complete->d_eso.scope = p.d_eso.scope;
+        DLOG(g_log<<"from dnsproxy::mainLoop: updated EDNS options from resolver EDNS source: "<<i->second.complete->d_eso.source.toString()<<" EDNS scope: "<<i->second.complete->d_eso.scope.toString()<<endl);
 
         if (mdp.d_header.rcode == RCode::NoError) {
           for (const auto & answer : mdp.d_answers) {        
index 5810bf1f0ab527f954c7ec52ae357a8c5d2205b9..ade4c82a301888e0756960b13c63b20e4a73c65f 100644 (file)
@@ -261,16 +261,6 @@ union ComboAddress {
     return ret;
   }
 
-  bool isValid() const
-  {
-    char host[1024];
-    int retval = 0;
-    if(sin4.sin_family && !(retval = getnameinfo(reinterpret_cast<const struct sockaddr*>(this), getSocklen(), host, sizeof(host),0, 0, NI_NUMERICHOST)))
-      return true;
-    else
-      return false;
-  }
-
   string toString() const
   {
     char host[1024];
@@ -605,11 +595,6 @@ public:
     return (ip & d_mask) == (ntohl(d_network.sin4.sin_addr.s_addr));
   }
 
-  bool isValid()
-  {
-    return d_network.isValid();
-  }
-  
   string toString() const
   {
     return d_network.toStringNoInterface()+"/"+std::to_string((unsigned int)d_bits);