From 0 Mon Sep 17 00:00:00 2001 From: Mikhail Efremov Date: Thu, 25 Oct 2012 16:17:49 +0400 Subject: [PATCH 13] dhclient: Request more options by default. Add DHO_NTP_SERVERS, DHO_INTERFACE_MTU and DHO_DOMAIN_SEARCH to the list of default requested DHCP options. Based on dhcp-4.2.0-default-requested-options.patch from Fedora. diff --git a/dhcp/client/clparse.c b/dhcp/client/clparse.c index defaced..defaced 100644 --- a/dhcp/client/clparse.c +++ b/dhcp/client/clparse.c @@ -31,7 +31,7 @@ struct client_config top_level_config; -#define NUM_DEFAULT_REQUESTED_OPTS 9 +#define NUM_DEFAULT_REQUESTED_OPTS 12 /* There can be 2 extra requested options for DHCPv4-over-DHCPv6. */ struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 2 + 1]; @@ -119,6 +119,21 @@ isc_result_t read_client_conf () option_code_hash_lookup(&default_requested_options[8], dhcpv6_universe.code_hash, &code, 0, MDL); + /* 10 */ + code = DHO_NTP_SERVERS; + option_code_hash_lookup(&default_requested_options[9], + dhcp_universe.code_hash, &code, 0, MDL); + + /* 11 */ + code = DHO_INTERFACE_MTU; + option_code_hash_lookup(&default_requested_options[10], + dhcp_universe.code_hash, &code, 0, MDL); + + /* 12 */ + code = DHO_DOMAIN_SEARCH; + option_code_hash_lookup(&default_requested_options[11], + dhcp_universe.code_hash, &code, 0, MDL); + for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) { if (default_requested_options[code] == NULL) log_fatal("Unable to find option definition for " diff --git a/dhcp/client/dhclient.conf.5 b/dhcp/client/dhclient.conf.5 index defaced..defaced 100644 --- a/dhcp/client/dhclient.conf.5 +++ b/dhcp/client/dhclient.conf.5 @@ -228,7 +228,8 @@ responding to the client send the client its values for the specified options. Only the option names should be specified in the request statement - not option parameters. By default, the DHCPv4 client requests the subnet-mask, broadcast-address, time-offset, routers, -domain-name, domain-name-servers and host-name options while the DHCPv6 +domain-search, domain-name, domain-name-servers, host-name, +ntp-servers and interface-mtu options while the DHCPv6 client requests the dhcp6 name-servers and domain-search options. Note that if you enter a \'request\' statement, you over-ride these defaults and these options will not be requested. @@ -773,7 +774,7 @@ interface "ep0" { supersede domain-search "example.com", "rc.isc.org", "home.isc.org"; prepend domain-name-servers 127.0.0.1; request subnet-mask, broadcast-address, time-offset, routers, - domain-name, domain-name-servers, host-name; + domain-search, domain-name, domain-name-servers, host-name; require subnet-mask, domain-name-servers; script "CLIENTBINDIR/dhclient-script"; media "media 10baseT/UTP", "media 10base2/BNC";