Skip to content

Properly Parse IPv6 AAAA RDATA in format_nmsg.go #50

Open
@GitMirar

Description

Properly handle AAAA records in

func parseRData(rdata []byte, rrtype int) string {
switch rrtype {
case RRT_A:
if len(rdata) != 4 {
// expecting exactly 4 byte
return "" // corrupt record
}
return fmt.Sprintf("%d.%d.%d.%d", rdata[0], rdata[1], rdata[2], rdata[3])
case RRT_NS, RRT_CNAME, RRT_MX:
return parseDomainString(rdata)
default:
return string(rdata)
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions