From: Ted Lemon Date: Thu, 9 Apr 1998 04:22:30 +0000 (+0000) Subject: Don't die if we can't handle a new client. Don't try to continue if accept fails. X-Git-Tag: carrel-2~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d87c528803940336054ee5f9cf34419b6786fcad;p=thirdparty%2Fdhcp.git Don't die if we can't handle a new client. Don't try to continue if accept fails. --- diff --git a/sysconfd/sysconfd.c b/sysconfd/sysconfd.c index 4bb03bc02..42f207322 100644 --- a/sysconfd/sysconfd.c +++ b/sysconfd/sysconfd.c @@ -44,7 +44,7 @@ #ifndef lint static char copyright[] = -"$Id: sysconfd.c,v 1.4 1998/03/16 06:19:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: sysconfd.c,v 1.5 1998/04/09 04:22:30 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -144,14 +144,18 @@ void new_connection (proto) int new_fd; tmp = (struct sysconf_client *)malloc (sizeof *tmp); - if (!tmp) - error ("Can't find memory for new client!"); + if (!tmp) { + warn ("Can't find memory for new client!"); + return; + } memset (tmp, 0, sizeof *tmp); namelen = sizeof name; new_fd = accept (proto -> fd, (struct sockaddr *)&name, &namelen); - if (new_fd < 0) + if (new_fd < 0) { warn ("accept: %m"); + return; + } tmp -> next = clients; tmp -> fd = new_fd;