Use case for selecting the address family (as in other places).

MFC after: 3 days
This commit is contained in:
Michael Tuexen 2012-07-14 20:08:03 +00:00
parent c9afdc3aa9
commit b5e0cd79c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238455

View File

@ -1203,11 +1203,18 @@ sctp_findassociation_ep_addr(struct sctp_inpcb **inp_p, struct sockaddr *remote,
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) {