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:
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: bpf.c,v 1.41 2000/07/27 09:02:29 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: bpf.c,v 1.42 2000/09/01 23:03:31 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -517,6 +517,12 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int supports_multiple_interfaces (ip)
|
||||||
|
struct interface_info *ip;
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void maybe_setup_fallback ()
|
void maybe_setup_fallback ()
|
||||||
{
|
{
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: discover.c,v 1.30 2000/07/06 22:37:39 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: discover.c,v 1.31 2000/09/01 23:03:33 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -489,10 +489,27 @@ void discover_interfaces (state)
|
|||||||
if (!tmp -> shared_network && (state == DISCOVER_SERVER)) {
|
if (!tmp -> shared_network && (state == DISCOVER_SERVER)) {
|
||||||
log_error ("No subnet declaration for %s (%s).",
|
log_error ("No subnet declaration for %s (%s).",
|
||||||
tmp -> name, inet_ntoa (foo.sin_addr));
|
tmp -> name, inet_ntoa (foo.sin_addr));
|
||||||
log_error ("Please write a subnet declaration in %s",
|
if (supports_multiple_interfaces (tmp)) {
|
||||||
"your dhcpd.conf file for the");
|
log_error ("Ignoring requests on %s.",
|
||||||
log_fatal ("network segment to which interface %s %s",
|
tmp -> name);
|
||||||
tmp -> name, "is attached.");
|
log_error ("If this is not what you want, %s",
|
||||||
|
"please write");
|
||||||
|
log_error ("a subnet declaration in your %s",
|
||||||
|
"dhcpd.conf file for");
|
||||||
|
log_error ("the network segment to %s %s %s",
|
||||||
|
"which interface",
|
||||||
|
tmp -> name, "is attached.");
|
||||||
|
goto next;
|
||||||
|
} else {
|
||||||
|
log_error ("You must write a subnet %s",
|
||||||
|
" declaration for this");
|
||||||
|
log_error ("subnet. You cannot prevent %s",
|
||||||
|
"the DHCP server");
|
||||||
|
log_error ("from listening on this subnet %s",
|
||||||
|
"because your");
|
||||||
|
log_fatal ("operating system does not %s.",
|
||||||
|
"support this capability");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find subnets that don't have valid interface
|
/* Find subnets that don't have valid interface
|
||||||
@@ -523,6 +540,7 @@ void discover_interfaces (state)
|
|||||||
tmp -> name);
|
tmp -> name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
next:
|
||||||
interface_dereference (&tmp, MDL);
|
interface_dereference (&tmp, MDL);
|
||||||
if (next)
|
if (next)
|
||||||
interface_reference (&tmp, next, MDL);
|
interface_reference (&tmp, next, MDL);
|
||||||
|
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dlpi.c,v 1.22 2000/07/27 09:02:31 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dlpi.c,v 1.23 2000/09/01 23:03:34 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -1311,6 +1311,12 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int supports_multiple_interfaces (ip)
|
||||||
|
struct interface_info *ip;
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void maybe_setup_fallback ()
|
void maybe_setup_fallback ()
|
||||||
{
|
{
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: lpf.c,v 1.26 2000/07/27 09:02:33 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: lpf.c,v 1.27 2000/09/01 23:03:35 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -388,6 +388,12 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int supports_multiple_interfaces (ip)
|
||||||
|
struct interface_info *ip;
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void maybe_setup_fallback ()
|
void maybe_setup_fallback ()
|
||||||
{
|
{
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: nit.c,v 1.31 2000/07/27 09:02:34 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: nit.c,v 1.32 2000/09/01 23:03:37 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -404,6 +404,12 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int supports_multiple_interfaces (ip)
|
||||||
|
struct interface_info *ip;
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void maybe_setup_fallback ()
|
void maybe_setup_fallback ()
|
||||||
{
|
{
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -131,9 +131,12 @@ int if_register_socket (info)
|
|||||||
(char *)&flag, sizeof flag) < 0)
|
(char *)&flag, sizeof flag) < 0)
|
||||||
log_fatal ("Can't set SO_REUSEADDR option on dhcp socket: %m");
|
log_fatal ("Can't set SO_REUSEADDR option on dhcp socket: %m");
|
||||||
|
|
||||||
/* Set the BROADCAST option so that we can broadcast DHCP responses. */
|
/* Set the BROADCAST option so that we can broadcast DHCP responses.
|
||||||
if (setsockopt (sock, SOL_SOCKET, SO_BROADCAST,
|
We shouldn't do this for fallback devices, and we can detect that
|
||||||
(char *)&flag, sizeof flag) < 0)
|
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");
|
log_fatal ("Can't set SO_BROADCAST option on dhcp socket: %m");
|
||||||
|
|
||||||
/* Bind the socket to this interface's IP address. */
|
/* Bind the socket to this interface's IP address. */
|
||||||
@@ -334,6 +337,16 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
#endif
|
#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,
|
/* If we have SO_BINDTODEVICE, set up a fallback interface; otherwise,
|
||||||
do not. */
|
do not. */
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: upf.c,v 1.20 2000/07/27 09:02:38 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: upf.c,v 1.21 2000/09/01 23:03:39 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -358,6 +358,12 @@ int can_receive_unicast_unconfigured (ip)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int supports_multiple_interfaces (ip)
|
||||||
|
struct interface_info *ip;
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void maybe_setup_fallback ()
|
void maybe_setup_fallback ()
|
||||||
{
|
{
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
Reference in New Issue
Block a user