Explorar o código

ceph: convert port endianness

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

Signed-off-by: Sage Weil <sage@newdream.net>
Sage Weil %!s(int64=16) %!d(string=hai) anos
pai
achega
f28bcfbe66
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      fs/ceph/messenger.c

+ 2 - 2
fs/ceph/messenger.c

@@ -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;
 }