Summary: mdns_resp_add_service: fix the max services guard.
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: ourairquality
Submitted on: Wed 03 Apr 2019 10:53:25 AM UTC
Priority: 5 - Normal
Assigned to: None
Discussion Lock: Any
Planned Release: None
[patch #9784] mdns_resp_add_service: fix the max services guard.
Follow-up Comment #2, patch #9784 (project lwip):
Yes it was wrong, thanks for checking. Attached another suggestion, a proposed
Would there be any consensus to change the mdns_resp_add_service() to return
an err_t and to add a separate argument in which to return the slot index?
Rather than conflating the err_t and the slot index in the result as is
currently done. So this would then parallel the convention used in
Would also like to change the type of the slot indexes in general to be u8_t
rather than s8_t.
There a pros and cons to conflating a result number to have an interpretation
as both an index and as some error value, but on the balance it usually seems
best to separate them so each can have a clear type.