File nbd-2.9.20-bigendian.diff of Package nbd

--- nbd-2.9.20/nbd-server.c	2011-01-28 13:34:16.000000000 +0100
+++ nbd-2.9.20/nbd-server.c	2011-04-04 17:03:04.000000000 +0200
@@ -1620,7 +1620,7 @@
 	struct sockaddr_storage netaddr;
 	struct sockaddr_in  *netaddr4 = NULL;
 	struct sockaddr_in6 *netaddr6 = NULL;
-	size_t addrinlen = sizeof( addrin );
+	socklen_t addrinlen = sizeof( addrin );
 	struct addrinfo hints;
 	struct addrinfo *ai = NULL;
 	char peername[NI_MAXHOST];
@@ -1630,10 +1630,10 @@
 	int e;
 	int shift;
 
-	if (getpeername(net, (struct sockaddr *) &addrin, (socklen_t *)&addrinlen) < 0)
+	if (getpeername(net, (struct sockaddr *) &addrin, &addrinlen) < 0)
 		err("getsockname failed: %m");
 
-	getnameinfo((struct sockaddr *)&addrin, (socklen_t)addrinlen,
+	getnameinfo((struct sockaddr *)&addrin, addrinlen,
 		peername, sizeof (peername), NULL, 0, NI_NUMERICHOST);
 
 	memset(&hints, '\0', sizeof (hints));
@@ -1666,7 +1666,7 @@
 				(netaddr4->sin_addr).s_addr>>=32-(client->server->cidrlen);
 				(netaddr4->sin_addr).s_addr<<=32-(client->server->cidrlen);
 
-				getnameinfo((struct sockaddr *) netaddr4, (socklen_t) addrinlen,
+				getnameinfo((struct sockaddr *) netaddr4, addrinlen,
 							netname, sizeof (netname), NULL, 0, NI_NUMERICHOST);
 				tmp=g_strdup_printf("%s/%s", netname, peername);
 			}else if(ai->ai_family == AF_INET6) {
@@ -1682,7 +1682,7 @@
 				(netaddr6->sin6_addr).s6_addr32[i]>>=shift;
 				(netaddr6->sin6_addr).s6_addr32[i]<<=shift;
 
-				getnameinfo((struct sockaddr *)netaddr6, (socklen_t)addrinlen,
+				getnameinfo((struct sockaddr *)netaddr6, addrinlen,
 					    netname, sizeof(netname), NULL, 0, NI_NUMERICHOST);
 				tmp=g_strdup_printf("%s/%s", netname, peername);
 			}
openSUSE Build Service is sponsored by