Unbreak sctp_connectx().
MFC after: 3 days
This commit is contained in:
parent
d27d338583
commit
cb0025aac6
@ -6356,7 +6356,7 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
struct sctp_tcb *stcb = NULL;
|
||||
unsigned int incr, at, i;
|
||||
|
||||
at = incr = 0;
|
||||
at = 0;
|
||||
sa = addr;
|
||||
*error = *num_v6 = *num_v4 = 0;
|
||||
/* account and validate addresses */
|
||||
@ -6364,6 +6364,7 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
switch (sa->sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in);
|
||||
if (sa->sa_len != incr) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
|
||||
*error = EINVAL;
|
||||
@ -6371,7 +6372,6 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
return (NULL);
|
||||
}
|
||||
(*num_v4) += 1;
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in);
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
@ -6387,6 +6387,7 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
*bad_addr = 1;
|
||||
return (NULL);
|
||||
}
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in6);
|
||||
if (sa->sa_len != incr) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
|
||||
*error = EINVAL;
|
||||
@ -6394,7 +6395,6 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr,
|
||||
return (NULL);
|
||||
}
|
||||
(*num_v6) += 1;
|
||||
incr = (unsigned int)sizeof(struct sockaddr_in6);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user