if (type == DHCP_DISCOVER && ifo->options & DHCPCD_REQUEST)
PUTADDR(DHO_IPADDRESS, ifo->req_addr);
+ /* RFC 2563 Auto Configure */
+ if (type == DHCP_DISCOVER && ifo->options & DHCPCD_IPV4LL) {
+ *p++ = DHO_AUTOCONFIGURE;
+ *p++ = 1;
+ *p++ = 1;
+ }
+
if (type == DHCP_DISCOVER ||
type == DHCP_INFORM ||
type == DHCP_REQUEST)
struct in_addr addr;
size_t i;
int auth_len;
+ char *msg;
/* We may have found a BOOTP server */
if (get_option_uint8(&type, dhcp, DHO_MESSAGETYPE) == -1)
/* We should restart on a NAK */
log_dhcp(LOG_WARNING, "NAK:", iface, dhcp, from);
+ if ((msg = get_option_string(dhcp, DHO_MESSAGE))) {
+ syslog(LOG_WARNING, "%s: message: %s",
+ iface->name, msg);
+ free(msg);
+ }
if (!(options & DHCPCD_TEST)) {
dhcp_drop(iface, "NAK");
unlink(state->leasefile);
return;
}
+ /* DHCP Auto-Configure, RFC 2563 */
+ if (type == DHCP_OFFER && dhcp->yiaddr == 0) {
+ log_dhcp(LOG_WARNING, "no address given", iface, dhcp, from);
+ if ((msg = get_option_string(dhcp, DHO_MESSAGE))) {
+ syslog(LOG_WARNING, "%s: message: %s",
+ iface->name, msg);
+ free(msg);
+ }
+ if (get_option_uint8(&tmp, dhcp, DHO_AUTOCONFIGURE) != 0) {
+ switch (tmp) {
+ case 0:
+ log_dhcp(LOG_WARNING, "IPv4LL disabled from",
+ iface, dhcp, from);
+ dhcp_close(iface);
+ eloop_timeout_delete(NULL, iface);
+ eloop_timeout_add_sec(DHCP_MAX, dhcp_discover,
+ iface);
+ break;
+ case 1:
+ log_dhcp(LOG_WARNING, "IPv4LL enabled from",
+ iface, dhcp, from);
+ eloop_timeout_delete(NULL, iface);
+ ipv4ll_start(iface);
+ break;
+ default:
+ syslog(LOG_ERR,
+ "%s: unknown auto configuration option %d",
+ iface->name, tmp);
+ break;
+ }
+ }
+ return;
+ }
+
/* Ensure that all required options are present */
for (i = 1; i < 255; i++) {
if (has_option_mask(ifo->requiremask, i) &&
DHO_RAPIDCOMMIT = 80, /* RFC 4039 */
DHO_FQDN = 81,
DHO_AUTHENTICATION = 90, /* RFC 3118 */
+ DHO_AUTOCONFIGURE = 116, /* RFC 2563 */
DHO_DNSSEARCH = 119, /* RFC 3397 */
DHO_CSR = 121, /* RFC 3442 */
DHO_VIVCO = 124, /* RFC 3925 */
define 100 string posix_timezone
define 101 string tzdb_timezone
+# DHCP Auto-Configuration, RFC2563
+define 116 byte auto_configure
+
# DHCP Subnet Selection, RFC3011
define 118 ipaddress subnet_selection
.Xr dhcpcd-run-hooks 8 ,
.Xr resolvconf 8
.Sh STANDARDS
-RFC\ 951, RFC\ 1534, RFC\ 2104, RFC\ 2131, RFC\ 2132, RFC\ 2855, RFC\ 3004,
-RFC\ 3118, RFC\ 3203, RFC\ 3315, RFC\ 3361, RFC\ 3633, RFC\ 3396, RFC\ 3397,
-RFC\ 3442, RFC\ 3495, RFC\ 3925, RFC\ 3927, RFC\ 4039, RFC\ 4075, RFC\ 4242,
-RFC\ 4361, RFC\ 4390, RFC\ 4702, RFC\ 4074, RFC\ 4861, RFC\ 4833, RFC\ 5227,
-RFC\ 5942, RFC\ 5969, RFC\ 6106, RFC\ 6334, RFC\ 6704.
+RFC\ 951, RFC\ 1534, RFC\ 2104, RFC\ 2131, RFC\ 2132, RFC\ 2563, RFC\ 2855,
+RFC\ 3004, RFC\ 3118, RFC\ 3203, RFC\ 3315, RFC\ 3361, RFC\ 3633, RFC\ 3396,
+RFC\ 3397, RFC\ 3442, RFC\ 3495, RFC\ 3925, RFC\ 3927, RFC\ 4039, RFC\ 4075,
+RFC\ 4242, RFC\ 4361, RFC\ 4390, RFC\ 4702, RFC\ 4074, RFC\ 4861, RFC\ 4833,
+RFC\ 5227, RFC\ 5942, RFC\ 5969, RFC\ 6106, RFC\ 6334, RFC\ 6704.
.Sh AUTHORS
.An Roy Marples Aq Mt roy@marples.name
.Sh BUGS