irrelevant (const struct dns_transmit *d, const char *buf, unsigned int len)
{
    unsigned int pos = 0;
    char out[12], *dn = NULL;

    if (!(pos = dns_packet_copy (buf, len, 0, out, 12)))
        return 1;
    if (byte_diff (out, 2, d->query + 2))
        return 1;
    if (out[4] != 0)
        return 1;
    if (out[5] != 1)
        return 1;

    if (!(pos = dns_packet_getname (buf, len, pos, &dn)))
        return 1;
    if (!dns_domain_equal (dn, d->query + 14))
    {
        alloc_free (dn);
        return 1;
    }
    alloc_free (dn);

    if (!(pos = dns_packet_copy (buf, len, pos, out, 4)))
        return 1;
    if (byte_diff (out, 2, d->qtype))
        return 1;
    if (byte_diff (out + 2, 2, DNS_C_IN))
        return 1;

    return 0;
}
irrelevant (const struct dns_transmit *d, const char *buf, unsigned int len)
{
    unsigned int pos = 0;
    char out[12], *dn = NULL;

    if (!(pos = dns_packet_copy (buf, len, 0, out, 12)))
        return 1;
    if (byte_diff (out, 2, d->query + 2))
        return 1;
    if (out[4] != 0)
        return 1;
    if (out[5] != 1)
        return 1;

    if (!(pos = dns_packet_getname (buf, len, pos, &dn)))
        return 1;
    if (!dns_domain_equal (dn, d->query + 14))
    {
        alloc_free (dn);
        return 1;
    }
    alloc_free (dn);

    if (!(pos = dns_packet_copy (buf, len, pos, out, 4)))
        return 1;
    if (byte_diff (out, 2, d->qtype))
        return 1;
    if (byte_diff (out + 2, 2, DNS_C_IN))
        return 1;

    return 0;
}