#ifndef lint
static char copyright[] =
-"$Id: dns.c,v 1.12 1999/10/07 06:35:41 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dns.c,v 1.13 2000/01/05 18:00:51 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if (dns_protocol_fd < 0)
log_fatal ("unable to create dns socket: %m");
+#if defined (HAVE_SETFD)
+ if (fcntl (dns_protocol_fd, F_SETFD, 1) < 0)
+ log_fatal ("unable to set close-on-exec on dns fd: %m");
+#endif
+
first_name_server ();
add_protocol ("dns", dns_protocol_fd, dns_packet, 0);
#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"
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,