71 lines
2.7 KiB
Diff
71 lines
2.7 KiB
Diff
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,
|
|
}
|
|
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)
|
|
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
|
|
@@ -729,6 +729,8 @@ intern(char *atom, enum dhcp_token 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-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,
|
|
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-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 {
|
|
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-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 {
|
|
PREFIX6 = 657,
|
|
FIXED_PREFIX6 = 658,
|
|
BOOTP_BROADCAST_ALWAYS = 659,
|
|
- CONFLICT_DONE = 660
|
|
+ CONFLICT_DONE = 660,
|
|
+ ANYCAST_MAC = 661
|
|
};
|
|
|
|
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|