ceph: convert port endianness

The port is informational only, but we should make it correct.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2009-11-04 11:46:35 -08:00
parent 6a18be16f7
commit f28bcfbe66

View file

@ -891,9 +891,9 @@ static int addr_port(struct sockaddr_storage *ss)
{
switch (ss->ss_family) {
case AF_INET:
return ((struct sockaddr_in *)ss)->sin_port;
return ntohs(((struct sockaddr_in *)ss)->sin_port);
case AF_INET6:
return ((struct sockaddr_in6 *)ss)->sin6_port;
return ntohs(((struct sockaddr_in6 *)ss)->sin6_port);
}
return 0;
}