svn commit: r252923 - stable/9/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun Jul 7 11:15:55 UTC 2013


Author: tuexen
Date: Sun Jul  7 11:15:54 2013
New Revision: 252923
URL: http://svnweb.freebsd.org/changeset/base/252923

Log:
  MFC r238455:
  Use case for selecting the address family (as in other places).

Modified:
  stable/9/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/9/sys/netinet/sctp_pcb.c	Sun Jul  7 11:10:15 2013	(r252922)
+++ stable/9/sys/netinet/sctp_pcb.c	Sun Jul  7 11:15:54 2013	(r252923)
@@ -1203,11 +1203,18 @@ sctp_findassociation_ep_addr(struct sctp
 	uint16_t rport;
 
 	inp = *inp_p;
-	if (remote->sa_family == AF_INET) {
+	switch (remote->sa_family) {
+#ifdef INET
+	case AF_INET:
 		rport = (((struct sockaddr_in *)remote)->sin_port);
-	} else if (remote->sa_family == AF_INET6) {
+		break;
+#endif
+#ifdef INET6
+	case AF_INET6:
 		rport = (((struct sockaddr_in6 *)remote)->sin6_port);
-	} else {
+		break;
+#endif
+	default:
 		return (NULL);
 	}
 	if (locked_tcb) {


More information about the svn-src-stable-9 mailing list