summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/udp6_usrreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/udp6_usrreq.c')
-rw-r--r--sys/netinet6/udp6_usrreq.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index dea8ed2..d0bcfc0 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -902,12 +902,9 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
goto out;
}
in6_sin6_2_sin(&sin, sin6_p);
- if (td && jailed(td->td_ucred))
- if (prison_remote_ip4(td->td_ucred,
- &sin.sin_addr) != 0) {
- error = EAFNOSUPPORT;
- goto out;
- }
+ if (td && (error = prison_remote_ip4(td->td_ucred,
+ &sin.sin_addr)) != 0)
+ goto out;
error = in_pcbconnect(inp, (struct sockaddr *)&sin,
td->td_ucred);
if (error == 0) {
@@ -922,12 +919,11 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
error = EISCONN;
goto out;
}
- if (td && jailed(td->td_ucred)) {
+ if (td) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
- if (prison_remote_ip6(td->td_ucred, &sin6->sin6_addr) != 0) {
- error = EAFNOSUPPORT;
+ if ((error = prison_remote_ip6(td->td_ucred,
+ &sin6->sin6_addr)) != 0)
goto out;
- }
}
error = in6_pcbconnect(inp, nam, td->td_ucred);
if (error == 0) {
OpenPOWER on IntegriCloud