Commit f28bcfbe authored by Sage Weil's avatar Sage Weil

ceph: convert port endianness

The port is informational only, but we should make it correct.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 6a18be16
...@@ -891,9 +891,9 @@ static int addr_port(struct sockaddr_storage *ss) ...@@ -891,9 +891,9 @@ static int addr_port(struct sockaddr_storage *ss)
{ {
switch (ss->ss_family) { switch (ss->ss_family) {
case AF_INET: case AF_INET:
return ((struct sockaddr_in *)ss)->sin_port; return ntohs(((struct sockaddr_in *)ss)->sin_port);
case AF_INET6: case AF_INET6:
return ((struct sockaddr_in6 *)ss)->sin6_port; return ntohs(((struct sockaddr_in6 *)ss)->sin6_port);
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment