]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Remove if_enable()
authorTed Lemon <source@isc.org>
Wed, 26 Feb 1997 05:20:53 +0000 (05:20 +0000)
committerTed Lemon <source@isc.org>
Wed, 26 Feb 1997 05:20:53 +0000 (05:20 +0000)
common/bpf.c
common/nit.c
common/socket.c

index 8584f009f908cebb1a2e7d77efa7ce3795da7bbe..d223a9f847139b1015533334a4db3c0fda7c7c21 100644 (file)
@@ -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
index 77c2ea155fb1d43206f4f949aab8d5a45de503d5..4c84f8bab236a055fd36f17940592910a570081f 100644 (file)
@@ -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
index 952f190c44d30a3e174b1d5e3d09d2c986a0c86f..d9cee6e227e4b691d63ac45d1f5b0fb324a1b501 100644 (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