Ensure that struct sockaddr is long enough...

This commit is contained in:
Michael Brown
2007-01-18 03:28:29 +00:00
parent 9828181e3b
commit 8ffbbebf11
2 changed files with 12 additions and 4 deletions
+10
View File
@@ -14,6 +14,9 @@
/** A socket address family */
typedef uint16_t sa_family_t;
/** Length of a @c struct @c sockaddr */
#define SA_LEN 32
/**
* Generalized socket address structure
*
@@ -26,6 +29,13 @@ struct sockaddr {
* This is an AF_XXX constant.
*/
sa_family_t sa_family;
/** Padding
*
* This ensures that a struct @c sockaddr_tcpip is large
* enough to hold a socket address for any TCP/IP address
* family.
*/
char pad[ SA_LEN - sizeof ( sa_family_t ) ];
};
#endif /* _GPXE_SOCKET_H */