-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mquery sends malformed packets when known-answer suppression kicks in #79
Comments
Hey @evverx , I also encountered that one, I did not yet do the PR, because I was trying to track what was the issue in on the ticket I created in About this issue, what I found out, is that it seems the Right now, what I am testing is the following patch: /* Copy the data bits only */
static void _a_copy(struct message *m, mdns_answer_t *a)
{
if (a->rdata) {
message_rdata_raw(m, a->rdata, a->rdlen);
return;
}
- if (a->type == QTYPE_A && a->ip.s_addr)
+ if (a->ip.s_addr)
message_rdata_ipv4(m, a->ip);
- else if (!IN6_IS_ADDR_UNSPECIFIED(&(a->ip6)))
+ else if (a->type == QTYPE_AAAA && && !IN6_IS_ADDR_UNSPECIFIED(&(a->ip6)))
message_rdata_ipv6(m, a->ip6);
if (a->type == QTYPE_SRV)
message_rdata_srv(m, a->srv.priority, a->srv.weight, a->srv.port, a->rdname);
else if (a->rdname)
message_rdata_name(m, a->rdname);
} Right now, it seems to have fixed the issues you also encountered on your side. Best, |
@MonkeyBreaker I'm not familiar with the codebase but I applied the following patch (based on your diff with the second diff --git a/libmdnsd/mdnsd.c b/libmdnsd/mdnsd.c
index 8f2d61a..4047a76 100644
--- a/libmdnsd/mdnsd.c
+++ b/libmdnsd/mdnsd.c
@@ -619,9 +619,9 @@ static void _a_copy(struct message *m, mdns_answer_t *a)
return;
}
- if (a->ip.s_addr)
+ if (a->type == QTYPE_A && a->ip.s_addr)
message_rdata_ipv4(m, a->ip);
- else if (!IN6_IS_ADDR_UNSPECIFIED(&(a->ip6)))
+ else if (a->type == QTYPE_AAAA && !IN6_IS_ADDR_UNSPECIFIED(&(a->ip6)))
message_rdata_ipv6(m, a->ip6);
if (a->type == QTYPE_SRV)
message_rdata_srv(m, a->srv.priority, a->srv.weight, a->srv.port, a->rdname); and I can't see the malformed packets any more. (Just to clarify I noticed it accidentally. I was just experimenting with |
I noticed log messages like
Received mdns UDP packet of size 128, ifindex=13, ttl=1, fragsize=0, sender=10.88.0.4, destination=224.0.0.251 Got mDNS query packet for id 0 Failed to extract resource records from incoming packet: Bad message mDNS query processing failed: Bad message
on various machines when I experimented with
mdnsd
in avahi/avahi#614.mquery
showsBelow are the packets it sent and received:
The queries where the known answers were added are malformed:
It's reproducible with 5346604.
The text was updated successfully, but these errors were encountered: