-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: Networking
Description
This function uses globals for the returned address information (ai_arr) as well as a global for the state of the getaddrinfo function (ai_state). This presents some problems:
- Multiple threads calling zsock_getaddrinfo() concurrently could lead to data corruption, either in ai_state or ai_arr or both. ai_state could be moved onto zsock_getaddrinfo's stack instead of being a global, but ai_arr is more complicated.
- The returned "res" pointer is supposed to be allocated. Right now, we cannot expose zsock_getaddrinfo() to user mode as user mode would not have access to ai_arr. What we need is something like malloc()/free() in minimal libc, possibly backed with the sys_mem_pool implementation.
Metadata
Metadata
Assignees
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: Networking