]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add generalized fallback support.
authorTed Lemon <source@isc.org>
Sun, 20 Dec 1998 18:21:52 +0000 (18:21 +0000)
committerTed Lemon <source@isc.org>
Sun, 20 Dec 1998 18:21:52 +0000 (18:21 +0000)
common/bpf.c

index e47aa1f7822ca0876e8dadf16bfe483607f60301..60ccb09ba4363296f79bf79bd273b589bcae07ef 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: bpf.c,v 1.19 1997/10/20 21:47:13 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: bpf.c,v 1.19.2.1 1998/12/20 18:21:52 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -255,6 +255,10 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
        unsigned char buf [256];
        struct iovec iov [2];
 
+       if (!strcmp (interface -> name, "fallback"))
+               return send_fallback (interface, packet, raw,
+                                     len, from, to, hto);
+
        /* Assemble the headers... */
        assemble_hw_header (interface, buf, &bufp, hto);
        assemble_udp_ip_header (interface, buf, &bufp, from.s_addr,
@@ -383,4 +387,20 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
        } while (!length);
        return 0;
 }
+
+int can_unicast_without_arp ()
+{
+       return 1;
+}
+
+void maybe_setup_fallback ()
+{
+       struct interface_info *fbi;
+       fbi = setup_fallback ();
+       if (fbi) {
+               if_register_fallback (fbi);
+               add_protocol ("fallback", fallback_interface -> wfdesc,
+                             fallback_discard, fallback_interface);
+       }
+}
 #endif