diff options
author | Ted Lemon <source@isc.org> | 1997-02-26 05:20:53 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1997-02-26 05:20:53 +0000 |
commit | 8d929f2fa2a37e3ef97e558814bab260034e5128 (patch) | |
tree | 4fe66b2643484c3a81c62248e19c0cbbea1176f7 | |
parent | de60690e73e2035a6638d112fdc879993fd4d26c (diff) | |
download | isc-dhcp-8d929f2fa2a37e3ef97e558814bab260034e5128.tar.gz |
Remove if_enable()
-rw-r--r-- | common/bpf.c | 24 | ||||
-rw-r--r-- | common/nit.c | 20 | ||||
-rw-r--r-- | common/socket.c | 37 |
3 files changed, 3 insertions, 78 deletions
diff --git a/common/bpf.c b/common/bpf.c index 8584f009..d223a9f8 100644 --- a/common/bpf.c +++ b/common/bpf.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: bpf.c,v 1.16 1997/02/19 10:49:20 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bpf.c,v 1.17 1997/02/26 05:20:52 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -382,25 +382,3 @@ size_t receive_packet (interface, buf, len, from, hfrom) return 0; } #endif - -#if defined (USE_BPF_SEND) -void if_enable (interface) - struct interface_info *interface; -{ - struct ifreq ifr; - int sock; - - if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) - error ("Can't create addrlist socket"); - - /* Bring the interface down and then up again to clear - * all its routes. */ - strncpy(ifr.ifr_name, interface -> name, IFNAMSIZ); - if (ioctl (sock, SIOCGIFFLAGS, &ifr) < 0) - error ("SIOCGIFFLAGS %s: %m", interface -> name); - - ifr.ifr_flags |= (IFF_UP|IFF_RUNNING); - if (ioctl(sock, SIOCSIFFLAGS, &ifr) == -1) - error ("SIOCSIFFLAGS %s: %m", interface -> name); -} -#endif diff --git a/common/nit.c b/common/nit.c index 77c2ea15..4c84f8ba 100644 --- a/common/nit.c +++ b/common/nit.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: nit.c,v 1.12 1997/02/19 10:49:20 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: nit.c,v 1.13 1997/02/26 05:20:53 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -343,21 +343,3 @@ size_t receive_packet (interface, buf, len, from, hfrom) return length; } #endif - -#if defined (USE_NIT_SEND) -void if_enable (interface) - struct interface_info *interface; -{ - struct ifreq ifr; - - /* Bring the interface down and then up again to clear - * all its routes. */ - strncpy(ifr.ifr_name, interface -> name, IFNAMSIZ); - if (ioctl(interface -> rfdesc, SIOCGIFFLAGS, &ifr) < 0) - error ("SIOCGIFFLAGS %s: %m", interface -> name); - - ifr.ifr_flags |= (IFF_UP|IFF_RUNNING); - if (ioctl(interface -> rfdesc, SIOCSIFFLAGS, &ifr) == -1) - error ("SIOCSIFFLAGS %s: %m", interface -> name); -} -#endif diff --git a/common/socket.c b/common/socket.c index 952f190c..d9cee6e2 100644 --- a/common/socket.c +++ b/common/socket.c @@ -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 |