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

- Do what people expect when they don't declare the subnet to which an

interface is attached.
This commit is contained in:
Ted Lemon
2000-09-01 23:03:39 +00:00
parent da41112751
commit 5cefe5e556
7 changed files with 75 additions and 14 deletions

View File

@@ -51,7 +51,7 @@
#ifndef lint
static char copyright[] =
"$Id: socket.c,v 1.51 2000/07/20 03:15:00 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
"$Id: socket.c,v 1.52 2000/09/01 23:03:38 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -131,9 +131,12 @@ int if_register_socket (info)
(char *)&flag, sizeof flag) < 0)
log_fatal ("Can't set SO_REUSEADDR option on dhcp socket: %m");
/* Set the BROADCAST option so that we can broadcast DHCP responses. */
if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST,
(char *)&flag, sizeof flag) < 0)
/* Set the BROADCAST option so that we can broadcast DHCP responses.
We shouldn't do this for fallback devices, and we can detect that
a device is a fallback because it has no ifp structure. */
if (info -> ifp &&
(setsockopt (sock, SOL_SOCKET, SO_BROADCAST,
(char *)&flag, sizeof flag) < 0))
log_fatal ("Can't set SO_BROADCAST option on dhcp socket: %m");
/* Bind the socket to this interface's IP address. */
@@ -334,6 +337,16 @@ int can_receive_unicast_unconfigured (ip)
#endif
}
int supports_multiple_interfaces (ip)
struct interface_info *ip;
{
#if defined (SO_BINDTODEVICE)
return 1;
#else
return 0;
#endif
}
/* If we have SO_BINDTODEVICE, set up a fallback interface; otherwise,
do not. */