2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

Remove if_enable()

This commit is contained in:
Ted Lemon
1997-02-26 05:20:53 +00:00
parent de60690e73
commit 8d929f2fa2
3 changed files with 3 additions and 78 deletions

View File

@@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
"$Id: socket.c,v 1.19 1997/02/19 10:49:19 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: socket.c,v 1.20 1997/02/26 05:20:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -136,14 +136,6 @@ int if_register_socket (info)
(char *)&flag, sizeof flag) < 0)
error ("Can't set SO_BROADCAST option on dhcp socket: %m");
#ifndef USE_SOCKET_FALLBACK
/* The following will make all-ones broadcasts go out this interface
* on those platforms which use the standard sockets API (assuming
* the OS-specific routines called by enable_sending() are present
* for this platform). */
if_enable (info);
#endif
/* Bind the socket to this interface's IP address. */
if (bind (sock, (struct sockaddr *)&name, sizeof name) < 0)
error ("Can't bind to dhcp address: %m");
@@ -235,30 +227,3 @@ size_t fallback_discard (interface)
(struct sockaddr *)&from, &flen);
}
#endif /* USE_SOCKET_RECEIVE */
#if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK)
/* If we're using the standard socket API without SO_BINDTODEVICE,
* we need this kludge to force DHCP broadcasts to go out
* this interface, even though it's not available for general
* use until we get a lease!
* This should work _OK_, but it will cause ALL all-ones
* broadcasts on this host to go out this interface--it
* could interfere with other interfaces. And God help you
* if you run this on multiple interfaces simultaneously.
* SO_BINDTODEVICE really is better! */
void if_enable (interface)
struct interface_info *interface;
{
#ifndef SO_BINDTODEVICE
struct in_addr broad_addr;
broad_addr.s_addr = htonl(INADDR_BROADCAST);
/* Delete old routes for broadcast address. */
remove_routes(NULL, &broad_addr);
/* Add a route for broadcast address to this interface. */
/* POTENTIAL PROBLEM: Don't do this to more than one interface! */
add_route_direct(interface, &broad_addr);
#endif
}
#endif