buglwIP - A Lightweight TCP/IP stack - Bugs: bug #55598, Clean shutdown and restart support


You are not allowed to post comments on this tracker with your current authentication level.

bug #55598: Clean shutdown and restart support

Submitted by:  Ben Schwartz <bemasc>
Submitted on:  Tue 29 Jan 2019 02:43:23 AM UTC  
Votes:  35  
Category:  None Severity:  3 - Normal
Item Group:  Feature Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  git head

Fri 21 Feb 2020 04:59:09 PM UTC, comment #3: 

Hmm, so as a start, we'd need a message to make tcpip_thread stop? That should not be too hard.

But then, how would you ensure that all applications are stopped? Is it enough to not call timers any more and stop TCP listening pcbs? Maybe adding an 'err' calback to TCP servers and udp/raw pcbs would do the trick? (see bug #48887)

Simon Goldschmidt <goldsimon>
Project Administrator
Fri 21 Feb 2020 01:41:48 AM UTC, comment #2: 

I also would like to see this change.  Even if it was an optional configuration.  An example is we can run our application on real embedded hardware or on Windows/Linux using the tap interface.  When on the PC, the code needs to be able to exit the application and shut down.  Asan always complains about the tcpip thread memory not deallocated at shutdown, but that seem to be all that is left after closing sockets and network interfaces etc.  I guess all services would need a de-init function as well.

Ashley Duncan <ashesman>
Wed 30 Jan 2019 01:30:02 AM UTC, comment #1: 

I second Ben's request. There usage scenarios that call for re-init lwIP or even just shut it down. Currently that is not possible because there is no way to exit from tcpip_thread.

Jose Simoes <jassimoes>
Tue 29 Jan 2019 02:43:23 AM UTC, original submission:  

Currently, lwip does not offer cleanup functionality, so once it is initialized, it must remain initialized until the process terminates.  This helps keep lwip lightweight and simple, and works well in embedded environments that start lwip at boot, but it does not always work well for other use cases, such as libraries that offer functionality backed by lwip.

Those use cases would seem to be better served if lwip offered sufficient API to clean up all initialized state, and later re-initialize if needed.

Ben Schwartz <bemasc>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by ashesman (Posted a comment)
  • -email is unavailable- added by bkausbk (Voted in favor of this item)
  • -email is unavailable- added by jassimoes (Posted a comment)
  • -email is unavailable- added by jassimoes (Voted in favor of this item)
  • -email is unavailable- added by bemasc (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 35 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-20 bkausbk Carbon-Copy- => Added bkausbk
    2019-01-30 jassimoes Carbon-Copy- => Added jassimoes

    Back to the top

    Powered by Savane 3.5