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

MFC after: 3 days
This commit is contained in:
tuexen 2012-07-14 20:08:03 +00:00
parent 01b851db7f
commit 7f0c39adad

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) {