diff options
author | dg <dg@FreeBSD.org> | 1995-02-15 11:30:35 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-02-15 11:30:35 +0000 |
commit | f4e59eab8045eadadc5be4fc2b7809d0b9544adf (patch) | |
tree | ebffe632dea54887a80ddc2fdf351b83ecb34650 /sys/kern/uipc_usrreq.c | |
parent | a33bb795d3d152797cd9b931fe3090918e864e41 (diff) | |
download | FreeBSD-src-f4e59eab8045eadadc5be4fc2b7809d0b9544adf.zip FreeBSD-src-f4e59eab8045eadadc5be4fc2b7809d0b9544adf.tar.gz |
Fixed bug caused by attempting a connect with a null 'nam'.
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index b856fee..41116de 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 - * $Id: uipc_usrreq.c,v 1.5 1994/10/02 17:35:36 phk Exp $ + * $Id: uipc_usrreq.c,v 1.6 1995/02/07 02:01:16 wollman Exp $ */ #include <sys/param.h> @@ -216,12 +216,19 @@ uipc_usrreq(so, req, m, nam, control) /* Connect if not connected yet. */ /* * Note: A better implementation would complain - * if already connected, nam non-zero and not - * equal to the peer's address. + * if not equal to the peer's address. */ - if ((so->so_state & SS_ISCONNECTED) == 0 && - (error = unp_connect(so, nam, p)) != 0) - break; /* XXX */ + if ((so->so_state & SS_ISCONNECTED) == 0) { + if (nam) { + error = unp_connect(so, nam, p); + if (error) + break; /* XXX */ + } else { + error = ENOTCONN; + break; + } + } + if (so->so_state & SS_CANTSENDMORE) { error = EPIPE; break; |