This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new a70a9f5ae6 net: Move s_flags to last to avoid the padding added by 
compiler
a70a9f5ae6 is described below

commit a70a9f5ae669c0edcb4d4f4f930b000d5646b771
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Tue Jan 17 00:21:39 2023 +0800

    net: Move s_flags to last to avoid the padding added by compiler
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 include/nuttx/net/net.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h
index 411997c672..504a927d55 100644
--- a/include/nuttx/net/net.h
+++ b/include/nuttx/net/net.h
@@ -202,10 +202,6 @@ struct socket_conn_s
   FAR struct devif_callback_s *list;
   FAR struct devif_callback_s *list_tail;
 
-  /* Definitions of 8-bit socket flags */
-
-  uint8_t       s_flags;     /* See _SF_* definitions */
-
   /* Socket options */
 
 #ifdef CONFIG_NET_SOCKOPTS
@@ -213,14 +209,18 @@ struct socket_conn_s
   sockopt_t     s_options;   /* Selected socket options */
   socktimeo_t   s_rcvtimeo;  /* Receive timeout value (in deciseconds) */
   socktimeo_t   s_sndtimeo;  /* Send timeout value (in deciseconds) */
-#ifdef CONFIG_NET_SOLINGER
+#  ifdef CONFIG_NET_SOLINGER
   socktimeo_t   s_linger;    /* Linger timeout value (in deciseconds) */
-#endif
-#ifdef CONFIG_NET_BINDTODEVICE
+#  endif
+#  ifdef CONFIG_NET_BINDTODEVICE
   uint8_t       s_boundto;   /* Index of the interface we are bound to.
                               * Unbound: 0, Bound: 1-MAX_IFINDEX */
+#  endif
 #endif
-#endif
+
+  /* Definitions of 8-bit socket flags */
+
+  uint8_t       s_flags;     /* See _SF_* definitions */
 
   /* Connection-specific content may follow */
 };

Reply via email to