Browse Source

Make the port numbers into Network Byte Order.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1698 fd59a12c-fef9-0310-b244-a6a79926bd2f
Christine Caulfield 17 years ago
parent
commit
476bc5e291
1 changed files with 2 additions and 2 deletions
  1. 2 2
      exec/totemip.c

+ 2 - 2
exec/totemip.c

@@ -226,7 +226,7 @@ int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
 		sin->sin_len = sizeof(struct sockaddr_in);
 #endif
 		sin->sin_family = ip_addr->family;
-		sin->sin_port = port;
+		sin->sin_port = ntohs(port);
 		memcpy(&sin->sin_addr, ip_addr->addr, sizeof(struct in_addr));
 		*addrlen = sizeof(struct sockaddr_in);
 		ret = 0;
@@ -240,7 +240,7 @@ int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
 		sin->sin6_len = sizeof(struct sockaddr_in6);
 #endif
 		sin->sin6_family = ip_addr->family;
-		sin->sin6_port = port;
+		sin->sin6_port = ntohs(port);
 		sin->sin6_scope_id = 2;
 		memcpy(&sin->sin6_addr, ip_addr->addr, sizeof(struct in6_addr));