Skip to content

Index out of bounds panic in main.rs:153:21 #5

@siebenmann

Description

@siebenmann

Running dnspeep on a Fedora 33 machine with both IPv4 and IPv6 connectivity I can sometimes see queries but then sooner or later I get:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/main.rs:153:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The backtrace doesn't seem to be very useful; it appears to be failing where it says it's failing, in the line:

    let question = &dns_packet.questions[0];

This seems to be the result of the authoritative DNS server I'm running on this machine answering a query by telling the sender to go away (I think):

In  IP [RANDOM-IP].30279 > [MYIP].domain: 5140+ [1au] ANY? . (33)
Out IP [MYIP].domain > [RANDOM-IP].30279: 5140-| [0q] 0/0/1 (23)

Wireshark confirms that the relevant DNS reply packet has no questions, no answer RRs, no authority RRs, and one additional RR of type OPT.

(This has already been useful, I had no idea people were spraying my authoritative nameserver with these queries.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions