From 4bc275176409a529f70ee5d4b7caeffd1c7923f5 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Tue, 14 Nov 2017 14:17:47 +0100 Subject: [PATCH] full removal of squatted XPF code point make XPF code point configurable in sdig remove XPF from dnsrecords and qtype check argument count for sdig modifiers --- pdns/dnsrecords.cc | 8 -------- pdns/dnsrecords.hh | 12 ------------ pdns/qtype.hh | 4 +--- pdns/sdig.cc | 36 ++++++++++++++++++++++++++---------- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index 0b7e92d54..39e662a56 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -134,13 +134,6 @@ void ARecordContent::doRecordCheck(const DNSRecord& dr) boilerplate_conv(AAAA, QType::AAAA, conv.xfrIP6(d_ip6); ); -boilerplate_conv(XPF, QType::XPF, conv.xfr8BitInt(d_version); - conv.xfr8BitInt(d_protocol); - conv.xfrCAWithoutPort(d_version, d_src); - conv.xfrCAWithoutPort(d_version, d_dst); - conv.xfrCAPort(d_src); - conv.xfrCAPort(d_dst)); - boilerplate_conv(NS, QType::NS, conv.xfrName(d_content, true)); boilerplate_conv(PTR, QType::PTR, conv.xfrName(d_content, true)); boilerplate_conv(CNAME, QType::CNAME, conv.xfrName(d_content, true)); @@ -624,7 +617,6 @@ void reportOtherTypes() DLVRecordContent::report(); DNSRecordContent::regist(QClass::ANY, QType::TSIG, &TSIGRecordContent::make, &TSIGRecordContent::make, "TSIG"); DNSRecordContent::regist(QClass::ANY, QType::TKEY, &TKEYRecordContent::make, &TKEYRecordContent::make, "TKEY"); - XPFRecordContent::report(); //TSIGRecordContent::report(); OPTRecordContent::report(); EUI48RecordContent::report(); diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 72afd9a6c..fe19b55c7 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -90,18 +90,6 @@ private: string d_ip6; // why?? }; -class XPFRecordContent : public DNSRecordContent -{ -public: - XPFRecordContent(uint8_t protocol, const ComboAddress& src, const ComboAddress& dst); - includeboilerplate(XPF); - - uint8_t d_version; - uint8_t d_protocol; - ComboAddress d_src; - ComboAddress d_dst; -}; - class MXRecordContent : public DNSRecordContent { public: diff --git a/pdns/qtype.hh b/pdns/qtype.hh index dccde072d..5d3577fcf 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -125,8 +125,7 @@ public: CAA=257, DLV=32769, ADDR=65400, - ALIAS=65401, - XPF=65422 + ALIAS=65401 }; typedef pair namenum; @@ -218,7 +217,6 @@ private: qtype_insert("DLV", 32769); qtype_insert("ADDR", 65400); qtype_insert("ALIAS", 65401); - qtype_insert("XPF", 65422); } } initializer; diff --git a/pdns/sdig.cc b/pdns/sdig.cc index c743427b8..70b2e50e2 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -36,7 +36,8 @@ try bool showflags=false; bool hidesoadetails=false; boost::optional ednsnm; - std::shared_ptr xpf; + uint16_t xpfcode = 0, xpfversion = 0, xpfproto = 0; + char *xpfsrc = NULL, *xpfdst = NULL; for(int i=1; itoPacket(pw); + ComboAddress src(xpfsrc), dst(xpfdst); + pw.startRecord(DNSName("."), xpfcode, 0, 1, DNSResourceRecord::ADDITIONAL); + // xpf->toPacket(pw); + pw.xfr8BitInt(xpfversion); + pw.xfr8BitInt(xpfproto); + pw.xfrCAWithoutPort(xpfversion, src); + pw.xfrCAWithoutPort(xpfversion, dst); + pw.xfrCAPort(src); + pw.xfrCAPort(dst); pw.commit(); } -- 2.40.0