git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build: Try to work around strict aliasing rules on Ubuntu 10.04
[samba.git]
/
lib
/
util
/
util_net.c
diff --git
a/lib/util/util_net.c
b/lib/util/util_net.c
index e5b33aa0a7e5b51d8eb9087f3539cfa6625b25eb..cb238adcf5d89dbe29e65b3d9418663301f6659e 100644
(file)
--- a/
lib/util/util_net.c
+++ b/
lib/util/util_net.c
@@
-918,11
+918,13
@@
int get_socket_port(int fd)
#if defined(HAVE_IPV6)
if (sa.ss_family == AF_INET6) {
#if defined(HAVE_IPV6)
if (sa.ss_family == AF_INET6) {
- return ntohs(((struct sockaddr_in6 *)&sa)->sin6_port);
+ struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)&sa;
+ return ntohs(sa_in6->sin6_port);
}
#endif
if (sa.ss_family == AF_INET) {
}
#endif
if (sa.ss_family == AF_INET) {
- return ntohs(((struct sockaddr_in *)&sa)->sin_port);
+ struct sockaddr_in *sa_in = (struct sockaddr_in *)&sa;
+ return ntohs(sa_in->sin_port);
}
return -1;
}
}
return -1;
}