Some cleanups.
MFC after: 3 days
This commit is contained in:
parent
72c123a8b4
commit
11e03b3200
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244730
@ -547,27 +547,21 @@ sctp_attach(struct socket *so, int proto SCTP_UNUSED, struct thread *p SCTP_UNUS
|
||||
static int
|
||||
sctp_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
|
||||
{
|
||||
struct sctp_inpcb *inp = NULL;
|
||||
int error;
|
||||
struct sctp_inpcb *inp;
|
||||
|
||||
#ifdef INET
|
||||
if (addr && addr->sa_family != AF_INET) {
|
||||
/* must be a v4 address! */
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
#endif /* INET6 */
|
||||
if (addr && (addr->sa_len != sizeof(struct sockaddr_in))) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
inp = (struct sctp_inpcb *)so->so_pcb;
|
||||
if (inp == NULL) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
error = sctp_inpcb_bind(so, addr, NULL, p);
|
||||
return (error);
|
||||
if (addr != NULL) {
|
||||
if ((addr->sa_family != AF_INET) ||
|
||||
(addr->sa_len != sizeof(struct sockaddr_in))) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
}
|
||||
return (sctp_inpcb_bind(so, addr, NULL, p));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user