~kf5jwc/dns-server-rs

e8eb1ab0fb35e40cb3fb2e15ae64e52d89d103c4 — Kyle Jones 6 months ago 25e7152
bugfix: write_u32 should accept a u32
2 files changed, 2 insertions(+), 2 deletions(-)

M src/dns_packet/byte_packet_buffer.rs
M src/dns_packet/dns_record.rs
M src/dns_packet/byte_packet_buffer.rs => src/dns_packet/byte_packet_buffer.rs +1 -1
@@ 135,7 135,7 @@ impl BytePacketBuffer {
    }

    #[allow(exceeding_bitshifts)]
    pub fn write_u32(&mut self, val: u16) -> Result<()> {
    pub fn write_u32(&mut self, val: u32) -> Result<()> {
        self.write(((val >> 24) & 0xFF) as u8)?;
        self.write(((val >> 16) & 0xFF) as u8)?;
        self.write(((val >>  8) & 0xFF) as u8)?;

M src/dns_packet/dns_record.rs => src/dns_packet/dns_record.rs +1 -1
@@ 62,7 62,7 @@ impl DnsRecord {
                buffer.write_qname(domain)?;
                buffer.write_u16(QueryType::A.into())?;
                buffer.write_u16(1)?;
                buffer.write_u32(ttl as u16)?;
                buffer.write_u32(ttl)?;
                buffer.write_u16(4)?;

                let octets = addr.octets();