diff options
| author | Jamie Gritton <jamie@FreeBSD.org> | 2009-02-05 14:06:09 +0000 | 
|---|---|---|
| committer | Jamie Gritton <jamie@FreeBSD.org> | 2009-02-05 14:06:09 +0000 | 
| commit | b89e82dd87dec9034c8b7f1a01524dceea11ff49 (patch) | |
| tree | 71fe0b10296684e7094a545ca78ed6f72789d82d /sys/netinet/tcp_usrreq.c | |
| parent | 9719301922b4612e967cf109913d18c2fe0e1563 (diff) | |
Notes
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
| -rw-r--r-- | sys/netinet/tcp_usrreq.c | 13 | 
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index f6dcae1a20b0..89987c4c7e42 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -441,8 +441,8 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)  	if (sinp->sin_family == AF_INET  	    && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr)))  		return (EAFNOSUPPORT); -	if (prison_remote_ip4(td->td_ucred, &sinp->sin_addr) != 0) -		return (EINVAL); +	if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) +		return (error);  	TCPDEBUG0;  	INP_INFO_WLOCK(&V_tcbinfo); @@ -508,10 +508,9 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)  		in6_sin6_2_sin(&sin, sin6p);  		inp->inp_vflag |= INP_IPV4;  		inp->inp_vflag &= ~INP_IPV6; -		if (prison_remote_ip4(td->td_ucred, &sin.sin_addr) != 0) { -			error = EINVAL; +		if ((error = prison_remote_ip4(td->td_ucred, +		    &sin.sin_addr)) != 0)  			goto out; -		}  		if ((error = tcp_connect(tp, (struct sockaddr *)&sin, td)) != 0)  			goto out;  		error = tcp_output_connect(so, nam); @@ -520,10 +519,8 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)  	inp->inp_vflag &= ~INP_IPV4;  	inp->inp_vflag |= INP_IPV6;  	inp->inp_inc.inc_flags |= INC_ISIPV6; -	if (prison_remote_ip6(td->td_ucred, &sin6p->sin6_addr) != 0) { -		error = EINVAL; +	if ((error = prison_remote_ip6(td->td_ucred, &sin6p->sin6_addr)) != 0)  		goto out; -	}  	if ((error = tcp6_connect(tp, nam, td)) != 0)  		goto out;  	error = tcp_output_connect(so, nam);  | 
