diff options
author | brian <brian@cvs.openbsd.org> | 2001-02-13 23:56:19 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2001-02-13 23:56:19 +0000 |
commit | 2c939f4bf1b38c758907c893a4a0d2ae9384a962 (patch) | |
tree | febd9b20f7b979f384c71513489baaa31272819b /usr.sbin/ppp | |
parent | e46995dd33ac21694ef0761f36e39f189084608e (diff) |
Don't even look at af_family if accept() returns sa->sa_len == 0
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ppp/server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ppp/ppp/server.c b/usr.sbin/ppp/ppp/server.c index d0e6801a483..f0fb72751e9 100644 --- a/usr.sbin/ppp/ppp/server.c +++ b/usr.sbin/ppp/ppp/server.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: server.c,v 1.10 2001/01/29 01:34:38 brian Exp $ + * $OpenBSD: server.c,v 1.11 2001/02/13 23:56:18 brian Exp $ */ #include <sys/param.h> @@ -102,6 +102,10 @@ server_Read(struct fdescriptor *d, struct bundle *bundle, const fd_set *fdset) wfd = accept(s->fd, sa, &ssize); if (wfd < 0) log_Printf(LogERROR, "server_Read: accept(): %s\n", strerror(errno)); + else if (sa->sa_len == 0) { + close(wfd); + wfd = -1; + } } else wfd = -1; |