[patch #9784] mdns_resp_add_service: fix the max services guard.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #9784] mdns_resp_add_service: fix the max services guard.

Wilfred
URL:
  <https://savannah.nongnu.org/patch/?9784>

                 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
                Category: apps
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

This should have been checking that the list was full.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 03 Apr 2019 10:53:25 AM UTC  Name:
0001-mdns_resp_add_service-fix-the-max-services-guard.patch  Size: 1KiB   By:
ourairquality

<http://savannah.nongnu.org/patch/download.php?file_id=46707>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9784>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9784] mdns_resp_add_service: fix the max services guard.

Wilfred
Follow-up Comment #1, patch #9784 (project lwip):

This patch looks wrong to me.
When list full, slot will be -1 (the init value).
So the original code is fine.


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9784>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9784] mdns_resp_add_service: fix the max services guard.

Wilfred
Follow-up Comment #2, patch #9784 (project lwip):

Yes it was wrong, thanks for checking. Attached another suggestion, a proposed
simplification.

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
mdns_search_service().

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.

(file #46754)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-mdns_resp_add_service-simplify-the-max-services-guar.patch
Size:1 KB
   
<https://savannah.nongnu.org/file/0001-mdns_resp_add_service-simplify-the-max-services-guar.patch?file_id=46754>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9784>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9784] mdns_resp_add_service: fix the max services guard.

Wilfred
Update of patch #9784 (project lwip):

                  Status:                    None => Done                  
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #3:

Applied, thanks!

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9784>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel