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) {
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];
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);