From: Ted Lemon Date: Mon, 23 Apr 2001 21:41:36 +0000 (+0000) Subject: If ICMP doesn't come up, continue. X-Git-Tag: V3-RC2-PATCH-1~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6f810c2d536ba90b1a4ad751b6b6597a4f7f791;p=thirdparty%2Fdhcp.git If ICMP doesn't come up, continue. --- diff --git a/common/icmp.c b/common/icmp.c index bac43b2dc..aa8463c4f 100644 --- a/common/icmp.c +++ b/common/icmp.c @@ -44,7 +44,7 @@ #ifndef lint static char copyright[] = -"$Id: icmp.c,v 1.29 2001/03/14 15:56:27 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n"; +"$Id: icmp.c,v 1.30 2001/04/23 21:41:36 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -59,6 +59,7 @@ struct icmp_state { static struct icmp_state *icmp_state; static omapi_object_type_t *dhcp_type_icmp; +static int no_icmp; #if defined (TRACING) trace_type_t *trace_icmp_input; @@ -119,8 +120,11 @@ void icmp_startup (routep, handler) /* Get a raw socket for the ICMP protocol. */ new -> socket = socket (AF_INET, SOCK_RAW, protocol); - if (new -> socket < 0) - log_fatal ("unable to create icmp socket: %m"); + if (new -> socket < 0) { + no_icmp = 1; + log_error ("unable to create icmp socket: %m"); + return; + } #if defined (HAVE_SETFD) if (fcntl (new -> socket, F_SETFD, 1) < 0) @@ -164,6 +168,8 @@ int icmp_echorequest (addr) trace_iov_t iov [2]; #endif + if (no_icmp) + return 1; if (!icmp_state) log_fatal ("ICMP protocol used before initialization.");