提交 f28bcfbe 编写于 作者: S Sage Weil

ceph: convert port endianness

The port is informational only, but we should make it correct.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 6a18be16
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册