From 4c863cf9fc45eb2c5b96abe84372ed27cdb3e1c8 Mon Sep 17 00:00:00 2001 From: Philip Homburg Date: Thu, 25 Aug 2005 10:47:24 +0000 Subject: [PATCH] Fixed 'connected' check. --- lib/ip/getpeername.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ip/getpeername.c b/lib/ip/getpeername.c index 3d5d826d0..39804ff41 100644 --- a/lib/ip/getpeername.c +++ b/lib/ip/getpeername.c @@ -47,8 +47,8 @@ static int _tcp_getpeername(int socket, struct sockaddr *_RESTRICT address, socklen_t len; struct sockaddr_in sin; - if (((tcpconfp->nwtc_flags & NWTC_REMADDR_MASK) != NWTC_SET_RA) || - ((tcpconfp->nwtc_flags & NWTC_REMPORT_MASK) != NWTC_SET_RP)) + if (tcpconfp->nwtc_remaddr == 0 || + tcpconfp->nwtc_remport == 0) { errno= ENOTCONN; return -1;