Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RFC2553 just says that sockaddr_storage has to have initial fields
[rsync/rsync.git]
/
socket.c
diff --git
a/socket.c
b/socket.c
index
2c2191e
..
94c28a6
100644
(file)
--- a/
socket.c
+++ b/
socket.c
@@
-578,6
+578,12
@@
char *client_addr(int fd)
}
}
+static sa_family_t get_sockaddr_family(const struct sockaddr_storage *ss)
+{
+ return ((struct sockaddr *) ss)->sa_family;
+}
+
+
/**
* Return the DNS name of the client
**/
/**
* Return the DNS name of the client
**/
@@
-606,7
+612,7
@@
char *client_name(int fd)
}
#ifdef INET6
}
#ifdef INET6
- if (
ss.ss_family
== AF_INET6 &&
+ if (
get_sockaddr_family(&ss)
== AF_INET6 &&
IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&ss)->sin6_addr)) {
struct sockaddr_in6 sin6;
struct sockaddr_in *sin;
IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&ss)->sin6_addr)) {
struct sockaddr_in6 sin6;
struct sockaddr_in *sin;
@@
-650,7
+656,7
@@
char *client_name(int fd)
/* XXX sin6_flowinfo and other fields */
for (res = res0; res; res = res->ai_next) {
/* XXX sin6_flowinfo and other fields */
for (res = res0; res; res = res->ai_next) {
- if (res->ai_family !=
ss.ss_family
)
+ if (res->ai_family !=
get_sockaddr_family(&ss)
)
continue;
if (res->ai_addrlen != length)
continue;
continue;
if (res->ai_addrlen != length)
continue;