svn commit: samba r23420 - in branches/SAMBA_4_0/source/lib/socket_wrapper: .

metze at samba.org metze at samba.org
Mon Jun 11 14:41:16 GMT 2007


Author: metze
Date: 2007-06-11 14:41:14 +0000 (Mon, 11 Jun 2007)
New Revision: 23420

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23420

Log:
try to make the IBM checker happy

metze
Modified:
   branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c	2007-06-11 14:40:23 UTC (rev 23419)
+++ branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c	2007-06-11 14:41:14 UTC (rev 23420)
@@ -174,7 +174,7 @@
 	}
 }
 
-static int socket_length(int family)
+static size_t socket_length(int family)
 {
 	switch (family) {
 	case AF_INET:
@@ -184,7 +184,7 @@
 		return sizeof(struct sockaddr_in6);
 #endif
 	}
-	return -1;
+	return 0;
 }
 
 
@@ -788,6 +788,9 @@
 		wire_hdr_len = sizeof(packet->ip.hdr) + sizeof(packet->ip.p.udp);
 		wire_len = wire_hdr_len + payload_len;
 		break;
+
+	default:
+		return NULL;
 	}
 
 	if (unreachable) {
@@ -1231,10 +1234,12 @@
 		if (type == SOCK_STREAM) {
 			break;
 		}
+		/*fall through*/
 	case 17:
 		if (type == SOCK_DGRAM) {
 			break;
 		}
+		/*fall through*/
 	default:
 		errno = EPROTONOSUPPORT;
 		return -1;
@@ -1278,7 +1283,7 @@
 	 * socket family
 	 */
 	my_addrlen = socket_length(parent_si->family);
-	if (my_addrlen < 0) {
+	if (my_addrlen <= 0) {
 		errno = EINVAL;
 		return -1;
 	}



More information about the samba-cvs mailing list