Conventional usage of the various struct sockaddr_xxx types involves
liberal use of casting, which tends to trigger strict-aliasing
warnings from gcc. Avoid these now and in future by marking all the
relevant types with __attribute__((may_alias)).
char pad[ sizeof ( struct sockaddr ) - sizeof ( sa_family_t )
- sizeof ( uint16_t )
- sizeof ( struct in_addr ) ];
-};
+} __attribute__ (( may_alias ));
/**
* IPv6 socket address
uint32_t sin6_flowinfo; /* Flow number */
struct in6_addr sin6_addr; /* 128-bit destination address */
uint32_t sin6_scope_id; /* Scope ID */
-};
+} __attribute__ (( may_alias ));
extern int inet_aton ( const char *cp, struct in_addr *inp );
extern char * inet_ntoa ( struct in_addr in );
#include <stdarg.h>
#include <gpxe/tables.h>
+#include <gpxe/socket.h>
struct xfer_interface;
struct uri;
-struct sockaddr;
/** Location types */
enum {
#include <gpxe/refcnt.h>
#include <gpxe/interface.h>
#include <gpxe/tables.h>
+#include <gpxe/socket.h>
-struct sockaddr;
struct resolv_interface;
/** Name resolution interface operations */
* family.
*/
char pad[ SA_LEN - sizeof ( sa_family_t ) ];
-};
+} __attribute__ (( may_alias ));
#endif /* _GPXE_SOCKET_H */
*/
char pad[ sizeof ( struct sockaddr ) -
( sizeof ( sa_family_t ) + sizeof ( uint16_t ) ) ];
-};
+} __attribute__ (( may_alias ));
/**
* A transport-layer protocol of the TCP/IP stack (eg. UDP, TCP, etc)
#include <gpxe/if_ether.h>
struct xfer_interface;
-struct sockaddr;
/**
* UDP constants