Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2012 20:08:03 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238455 - head/sys/netinet
Message-ID:  <201207142008.q6EK83GG004933@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Jul 14 20:08:03 2012
New Revision: 238455
URL: http://svn.freebsd.org/changeset/base/238455

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

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Sat Jul 14 19:44:39 2012	(r238454)
+++ head/sys/netinet/sctp_pcb.c	Sat Jul 14 20:08:03 2012	(r238455)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207142008.q6EK83GG004933>