mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-04 00:05:30 +00:00
Test return value of socket for <0, not ==0 to indicate failure.
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dns.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dns.c,v 1.5 1997/11/29 07:51:49 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -85,7 +85,7 @@ void dns_startup ()
|
|||||||
|
|
||||||
/* Get a socket for the DNS protocol. */
|
/* Get a socket for the DNS protocol. */
|
||||||
dns_protocol_fd = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
dns_protocol_fd = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
if (!dns_protocol_fd)
|
if (dns_protocol_fd < 0)
|
||||||
error ("unable to create dns socket: %m");
|
error ("unable to create dns socket: %m");
|
||||||
|
|
||||||
pick_name_server ();
|
pick_name_server ();
|
||||||
|
Reference in New Issue
Block a user