[gdm] Don't cast sockaddr_storage to sockaddr



commit 7b1e47a97d941c59599974ea421e68e1e682d70a
Author: Ray Strode <rstrode redhat com>
Date:   Thu Jun 17 13:15:06 2010 -0400

    Don't cast sockaddr_storage to sockaddr
    
    Apparently it causes aliasing warnings on some machines.

 common/gdm-address.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/common/gdm-address.h b/common/gdm-address.h
index 6cb26b1..c4d8af3 100644
--- a/common/gdm-address.h
+++ b/common/gdm-address.h
@@ -35,7 +35,7 @@
 G_BEGIN_DECLS
 
 #define GDM_TYPE_ADDRESS (gdm_address_get_type ())
-#define	gdm_sockaddr_len(sa) (((struct sockaddr *)sa)->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
+#define	gdm_sockaddr_len(sa) ((sa)->ss_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
 
 typedef struct _GdmAddress GdmAddress;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]