interface is attached.
#ifndef lint
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 */
#include "dhcpd.h"
return 1;
}
+int supports_multiple_interfaces (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
isc_result_t status;
#ifndef lint
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 */
#include "dhcpd.h"
if (!tmp -> shared_network && (state == DISCOVER_SERVER)) {
log_error ("No subnet declaration for %s (%s).",
tmp -> name, inet_ntoa (foo.sin_addr));
- log_error ("Please write a subnet declaration in %s",
- "your dhcpd.conf file for the");
- log_fatal ("network segment to which interface %s %s",
- tmp -> name, "is attached.");
+ if (supports_multiple_interfaces (tmp)) {
+ log_error ("Ignoring requests on %s.",
+ tmp -> name);
+ 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
tmp -> name);
}
#endif
+ next:
interface_dereference (&tmp, MDL);
if (next)
interface_reference (&tmp, next, MDL);
#ifndef lint
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 */
#include "dhcpd.h"
return 1;
}
+int supports_multiple_interfaces (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
isc_result_t status;
#ifndef lint
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 */
#include "dhcpd.h"
return 1;
}
+int supports_multiple_interfaces (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
isc_result_t status;
#ifndef lint
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 */
#include "dhcpd.h"
return 1;
}
+int supports_multiple_interfaces (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
isc_result_t status;
#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"
(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. */
#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. */
#ifndef lint
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 */
#include "dhcpd.h"
return 1;
}
+int supports_multiple_interfaces (ip)
+ struct interface_info *ip;
+{
+ return 1;
+}
+
void maybe_setup_fallback ()
{
isc_result_t status;