troglobit / mdnsd

Jeremie Miller's original mdnsd
BSD 3-Clause "New" or "Revised" License
55 stars 35 forks source link

Resource record comparison is broken #71

Closed fzs closed 1 year ago

fzs commented 1 year ago

The _a_match function in libmdnsd/mdnsd.c seems broken. I have a hard time understanding what it is supposed to do, even though it seems simple enough. But I guess it is supposed to return 1 if the input record is identical to the input stored answer, and 0otherwise.

In that case the comparison of A and AAAA records is broken because it will always return 1 for these types of records.

https://github.com/troglobit/mdnsd/blob/46e13a0a86dd789033e296904a108eccfc081f00/libmdnsd/mdnsd.c#L205-L206

fzs commented 1 year ago

I am ready to create a PR fixing this, unless there is a reason why this comparison is this way.

troglobit commented 1 year ago

Please go ahead! I think you are the only brave soul who have traveled this far into libmdnsd for a long while.