2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

Set close-on-exec if possible.

This commit is contained in:
Ted Lemon
2000-01-05 18:01:41 +00:00
parent 31730f17c7
commit f7c83eb431
2 changed files with 12 additions and 2 deletions

View File

@@ -23,7 +23,7 @@
#ifndef lint
static char copyright[] =
"$Id: icmp.c,v 1.15 1999/09/09 23:26:12 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
"$Id: icmp.c,v 1.16 2000/01/05 18:01:41 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -83,6 +83,11 @@ void icmp_startup (routep, handler)
if (new -> socket < 0)
log_fatal ("unable to create icmp socket: %m");
#if defined (HAVE_SETFD)
if (fcntl (new -> socket, F_SETFD, 1) < 0)
log_error ("Can't set close-on-exec on icmp socket: %m");
#endif
/* Make sure it does routing... */
state = 0;
if (setsockopt (new -> socket, SOL_SOCKET, SO_DONTROUTE,