dhcp/dhcp-4.1.0-dhclient-anycast.patch
David Cantrell 4bf24c8243 - Upgraded to ISC dhcp-4.1.0
- Had to rename the -T option to -timeout as ISC is now using -T
- Allow package rebuilders to easily enable DHCPv6 support with: rpmbuild
    --with DHCPv6 dhcp.spec Note that Fedora is still using the 'dhcpv6'
    package, but some users may want to experiment with the ISC DHCPv6
    implementation locally.
2009-01-06 23:50:29 +00:00

71 lines
2.7 KiB
Diff

diff -up dhcp-4.1.0/client/clparse.c.anycast dhcp-4.1.0/client/clparse.c
--- dhcp-4.1.0/client/clparse.c.anycast 2009-01-06 10:43:52.000000000 -1000
+++ dhcp-4.1.0/client/clparse.c 2009-01-06 10:43:53.000000000 -1000
@@ -558,6 +558,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.0/common/conflex.c.anycast dhcp-4.1.0/common/conflex.c
--- dhcp-4.1.0/common/conflex.c.anycast 2009-01-06 10:43:52.000000000 -1000
+++ dhcp-4.1.0/common/conflex.c 2009-01-06 10:43:53.000000000 -1000
@@ -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.0/common/lpf.c.anycast dhcp-4.1.0/common/lpf.c
--- dhcp-4.1.0/common/lpf.c.anycast 2009-01-06 10:43:52.000000000 -1000
+++ dhcp-4.1.0/common/lpf.c 2009-01-06 10:43:53.000000000 -1000
@@ -333,6 +333,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.0/includes/dhcpd.h.anycast dhcp-4.1.0/includes/dhcpd.h
--- dhcp-4.1.0/includes/dhcpd.h.anycast 2009-01-06 10:43:53.000000000 -1000
+++ dhcp-4.1.0/includes/dhcpd.h 2009-01-06 10:43:53.000000000 -1000
@@ -1215,6 +1215,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.0/includes/dhctoken.h.anycast dhcp-4.1.0/includes/dhctoken.h
--- dhcp-4.1.0/includes/dhctoken.h.anycast 2009-01-06 10:43:52.000000000 -1000
+++ dhcp-4.1.0/includes/dhctoken.h 2009-01-06 10:49:12.000000000 -1000
@@ -353,7 +353,8 @@ enum dhcp_token {
TEMPORARY = 656,
PREFIX6 = 657,
FIXED_PREFIX6 = 658,
- BOOTP_BROADCAST_ALWAYS = 659
+ BOOTP_BROADCAST_ALWAYS = 659,
+ ANYCAST_MAC = 660
};
#define is_identifier(x) ((x) >= FIRST_TOKEN && \