diff options
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
| -rw-r--r-- | sys/netinet/sctp_pcb.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 291509ed20ff..b9b7218bda99 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2649,9 +2649,9 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, * will transmute the ip address to the * proper value. */ - if (p && prison_local_ip4(p->td_ucred, &sin->sin_addr) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip4(p->td_ucred, &sin->sin_addr)) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (sin->sin_addr.s_addr != INADDR_ANY) { bindall = 0; @@ -2680,10 +2680,10 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, * will transmute the ipv6 address to the * proper value. */ - if (p && prison_local_ip6(p->td_ucred, &sin6->sin6_addr, - (SCTP_IPV6_V6ONLY(inp) != 0)) != 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); - return (EINVAL); + if (p && (error = prison_local_ip6(p->td_ucred, &sin6->sin6_addr, + (SCTP_IPV6_V6ONLY(inp) != 0))) != 0) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); + return (error); } if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; |
