Blob Blame Raw
diff -up dhcp-3.1.0/common/lpf.c.anycast dhcp-3.1.0/common/lpf.c
--- dhcp-3.1.0/common/lpf.c.anycast	2007-10-22 16:16:48.000000000 -0400
+++ dhcp-3.1.0/common/lpf.c	2007-10-22 16:19:01.000000000 -0400
@@ -334,6 +334,9 @@ ssize_t send_packet (interface, packet, 
 		return send_fallback (interface, packet, raw,
 				      len, from, to, hto);
 
+	if (hto == NULL && interface->anycast_mac_addr.hlen)
+		hto = &interface->anycast_mac_addr;
+
 	/* Assemble the headers... */
 	assemble_hw_header (interface, (unsigned char *)hh, &hbufp, hto);
 	fudge = hbufp % 4;	/* IP header must be word-aligned. */
diff -up dhcp-3.1.0/common/conflex.c.anycast dhcp-3.1.0/common/conflex.c
--- dhcp-3.1.0/common/conflex.c.anycast	2007-10-22 16:16:47.000000000 -0400
+++ dhcp-3.1.0/common/conflex.c	2007-10-22 16:18:52.000000000 -0400
@@ -549,6 +549,8 @@ static enum dhcp_token intern (atom, dfv
 		}
 		if (!strcasecmp (atom + 1, "nd"))
 			return AND;
+		if (!strcasecmp (atom + 1, "nycast-mac"))
+			return ANYCAST_MAC;
 		if (!strcasecmp (atom + 1, "ppend"))
 			return APPEND;
 		if (!strcasecmp (atom + 1, "llow"))
diff -up dhcp-3.1.0/includes/site.h.anycast dhcp-3.1.0/includes/site.h
--- dhcp-3.1.0/includes/site.h.anycast	2007-10-22 16:16:47.000000000 -0400
+++ dhcp-3.1.0/includes/site.h	2007-10-22 16:19:43.000000000 -0400
@@ -184,6 +184,8 @@
 
 #define TRACING
 
+#define USE_LPF
+
 /* Define this if you want to read your config from LDAP. Read README.ldap
    about how to set this up */
 
diff -up dhcp-3.1.0/includes/dhcpd.h.anycast dhcp-3.1.0/includes/dhcpd.h
--- dhcp-3.1.0/includes/dhcpd.h.anycast	2007-10-22 16:16:48.000000000 -0400
+++ dhcp-3.1.0/includes/dhcpd.h	2007-10-22 16:19:17.000000000 -0400
@@ -990,6 +990,7 @@ struct interface_info {
 	int dlpi_sap_length;
 	struct hardware dlpi_broadcast_addr;
 # endif /* DLPI_SEND || DLPI_RECEIVE */
+	struct hardware anycast_mac_addr;
 };
 
 struct hardware_link {
diff -up dhcp-3.1.0/includes/dhctoken.h.anycast dhcp-3.1.0/includes/dhctoken.h
--- dhcp-3.1.0/includes/dhctoken.h.anycast	2007-10-22 16:16:48.000000000 -0400
+++ dhcp-3.1.0/includes/dhctoken.h	2007-10-22 16:20:33.000000000 -0400
@@ -326,7 +326,8 @@ enum dhcp_token {
 	DOMAIN_LIST = 630,
 	LEASEQUERY = 631,
 	EXECUTE = 632,
-	BOOTP_BROADCAST_ALWAYS = 633
+	BOOTP_BROADCAST_ALWAYS = 633,
+	ANYCAST_MAC = 634
 };
 
 #define is_identifier(x)	((x) >= FIRST_TOKEN &&	\
diff -up dhcp-3.1.0/client/clparse.c.anycast dhcp-3.1.0/client/clparse.c
--- dhcp-3.1.0/client/clparse.c.anycast	2007-10-22 16:16:48.000000000 -0400
+++ dhcp-3.1.0/client/clparse.c	2007-10-22 16:18:40.000000000 -0400
@@ -407,6 +407,17 @@ void parse_client_statement (cfile, ip, 
 		}
 		return;
 
+	      case ANYCAST_MAC:
+		token = next_token (&val, (unsigned *)0, cfile);
+		if (ip) {
+			parse_hardware_param (cfile, &ip -> anycast_mac_addr);
+		} else {
+			parse_warn (cfile, "anycast mac address parameter %s",
+				    "not allowed here.");
+			skip_to_semi (cfile);
+		}
+		return;
+
 	      case REQUEST:
 		token = next_token (&val, (unsigned *)0, cfile);
 		if (config -> requested_options == default_requested_options)