2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/client/clparse.c.anycast dhcp-4.1.1/client/clparse.c
|
|
|
|
--- dhcp-4.1.1/client/clparse.c.anycast 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/client/clparse.c 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
@@ -571,6 +571,17 @@ void parse_client_statement (cfile, ip,
|
2009-01-06 23:50:29 +00:00
|
|
|
}
|
|
|
|
return;
|
2008-01-13 21:02:47 +00:00
|
|
|
|
2009-01-06 23:50:29 +00:00
|
|
|
+ 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;
|
2008-01-13 21:02:47 +00:00
|
|
|
+
|
2009-01-06 23:50:29 +00:00
|
|
|
case REQUEST:
|
|
|
|
token = next_token (&val, (unsigned *)0, cfile);
|
|
|
|
if (config -> requested_options == default_requested_options)
|
2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/common/conflex.c.anycast dhcp-4.1.1/common/conflex.c
|
|
|
|
--- dhcp-4.1.1/common/conflex.c.anycast 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/common/conflex.c 2010-01-20 17:19:37.000000000 +0100
|
2009-01-06 23:50:29 +00:00
|
|
|
@@ -729,6 +729,8 @@ intern(char *atom, enum dhcp_token dfv)
|
2008-01-13 21:02:47 +00:00
|
|
|
}
|
|
|
|
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"))
|
2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/common/lpf.c.anycast dhcp-4.1.1/common/lpf.c
|
|
|
|
--- dhcp-4.1.1/common/lpf.c.anycast 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/common/lpf.c 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
@@ -334,6 +334,9 @@ ssize_t send_packet (interface, packet,
|
2009-01-06 23:50:29 +00:00
|
|
|
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. */
|
2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/includes/dhcpd.h.anycast dhcp-4.1.1/includes/dhcpd.h
|
|
|
|
--- dhcp-4.1.1/includes/dhcpd.h.anycast 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/includes/dhcpd.h 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
@@ -1217,6 +1217,7 @@ struct interface_info {
|
2008-01-13 21:02:47 +00:00
|
|
|
int dlpi_sap_length;
|
|
|
|
struct hardware dlpi_broadcast_addr;
|
|
|
|
# endif /* DLPI_SEND || DLPI_RECEIVE */
|
|
|
|
+ struct hardware anycast_mac_addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hardware_link {
|
2010-01-20 17:07:47 +00:00
|
|
|
diff -up dhcp-4.1.1/includes/dhctoken.h.anycast dhcp-4.1.1/includes/dhctoken.h
|
|
|
|
--- dhcp-4.1.1/includes/dhctoken.h.anycast 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
+++ dhcp-4.1.1/includes/dhctoken.h 2010-01-20 17:19:37.000000000 +0100
|
|
|
|
@@ -354,7 +354,8 @@ enum dhcp_token {
|
2009-01-06 23:50:29 +00:00
|
|
|
PREFIX6 = 657,
|
|
|
|
FIXED_PREFIX6 = 658,
|
2010-01-20 17:07:47 +00:00
|
|
|
BOOTP_BROADCAST_ALWAYS = 659,
|
|
|
|
- CONFLICT_DONE = 660
|
|
|
|
+ CONFLICT_DONE = 660,
|
|
|
|
+ ANYCAST_MAC = 661
|
2008-01-13 21:02:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|