nuttxs opened a new pull request, #14595:
URL: https://github.com/apache/nuttx/pull/14595

   ## Summary
   sys/socket: use __attribute__((packed)) to avoid changes in the size of 
struct sockaddr_storage due to struct alignment.
   
   Referencing [RFC 
2553#section-3.10](https://datatracker.ietf.org/doc/html/rfc2553#section-3.10) 
and the [POSIX standard 
documentation](https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html).
   Defines the maximum size of the structure, which is typically 128 bytes.The 
current output structure size (sizeof(struct sockaddr_storage)) is 136, which 
does not match this.
   This discrepancy can also lead to the following potential issues:
   1.An increase in the BSS segment size.
   2.Functions may experience alignment issues, such as getifaddrs(&ifap) being 
unable to read the correct IP address.
      The data passed to struct sockaddr_in is shifted, causing incorrect 
address parsing.
   
   ## Impact
   
   ## Testing
   Testing with ESP32/ESP32S3 and sim over a long period of time.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to