From c242a2e460e8ec94f8468aa82c31ee32be2d8147 Mon Sep 17 00:00:00 2001 From: Litr0 Date: Tue, 31 Oct 2023 16:25:08 -0300 Subject: [PATCH] add DNAME type code in from_bytes --- src/message/rdata.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/message/rdata.rs b/src/message/rdata.rs index e121718c..bcfc88c1 100644 --- a/src/message/rdata.rs +++ b/src/message/rdata.rs @@ -187,7 +187,20 @@ impl FromBytes> for Rdata { Ok(Rdata::SomeTxtRdata(rdata)) } - //////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + 39 => { + let rdata = CnameRdata::from_bytes(&bytes[..bytes.len() - 4], full_msg); + + match rdata { + Ok(_) => {} + Err(e) => { + return Err(e); + } + } + + Ok(Rdata::SomeCnameRdata(rdata.unwrap())) + } + //////////////// Replace the next line when type OPT is implemented //////////// 41 => { println!("OPT");