diff options
author | Ted Lemon <source@isc.org> | 2000-01-05 18:01:41 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-01-05 18:01:41 +0000 |
commit | f7c83eb431fe5c3600e9af336da50f1aea92353a (patch) | |
tree | 94dafb9fc48a42a1af9c8dc7ed5080d78849624e /common/icmp.c | |
parent | 31730f17c7c148790e4de85fee74a1d4ec9d4c45 (diff) | |
download | isc-dhcp-f7c83eb431fe5c3600e9af336da50f1aea92353a.tar.gz |
Set close-on-exec if possible.
Diffstat (limited to 'common/icmp.c')
-rw-r--r-- | common/icmp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/icmp.c b/common/icmp.c index 62c83b37..8265460b 100644 --- a/common/icmp.c +++ b/common/icmp.c @@ -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, |