trailing bits of EDNS Client Subnet mask. So if you'd truncate something as
a /9, we'd have to use 2 bytes anyhow, but we would not zero the last 7 bits.
We do now. Thanks Mukund & ISC!
(cherry picked from commit
d7da15c560946cadaadfc173b8964dd6b40932ed)
../../pdns/dnsrecords.cc \
../../pdns/dnssecinfra.cc \
../../pdns/ednssubnet.cc \
+ ../../pdns/iputils.cc \
../../pdns/logger.cc \
../../pdns/misc.cc \
../../pdns/nsecrecords.cc \
dnsrecords.cc \
dnswriter.cc dnswriter.hh \
ednssubnet.cc \
+ iputils.hh iputils.cc \
logger.cc \
misc.cc misc.hh \
nsecrecords.cc \
dnssecinfra.cc \
dnswriter.cc dnswriter.hh \
ednssubnet.cc ednssubnet.hh \
+ iputils.cc iputils.hh \
filterpo.hh \
gss_context.cc gss_context.hh \
logger.cc \
dnswriter.cc dnswriter.hh \
ednssubnet.cc ednssubnet.hh \
ednsoptions.cc ednsoptions.hh \
+ iputils.hh iputils.cc \
logger.cc \
misc.cc \
nsecrecords.cc \
ret.assign((const char*)&esow, sizeof(esow));
int octetsout = ((esow.sourceMask - 1)>> 3)+1;
+ ComboAddress src=eso.source.getNetwork();
+ src.truncate(esow.sourceMask);
+
if(family == htons(1))
- ret.append((const char*) &eso.source.getNetwork().sin4.sin_addr.s_addr, octetsout);
+ ret.append((const char*) &src.sin4.sin_addr.s_addr, octetsout);
else
- ret.append((const char*) &eso.source.getNetwork().sin6.sin6_addr.s6_addr, octetsout);
+ ret.append((const char*) &src.sin6.sin6_addr.s6_addr, octetsout);
return ret;
}