Skip to content

DHCPv6 and DHCP options on the same line in dhcpcd.conf(5) can cause problems #606

@zacknewman

Description

@zacknewman

dhcpcd.conf(5) states:

⋮
     option option
             Requests the option from the server.  It can be a variable to be
             used in dhcpcd-run-hooks(8) or the numerical value.  You can
             specify more options separated by commas, spaces or more option
             lines.  Prepend dhcp6_ to option to request a DHCPv6 option.  If
             no DHCPv6 options are configured, then DHCPv4 options are mapped
             to equivalent DHCPv6 options.

             Prepend nd_ to option to handle ND options, but this only works
             for the nooption, reject and require options.

             To see a list of options you can use, call dhcpcd with the -V,
             --variables argument.
⋮

It explicitly states that DHCPv6, ND, and DHCP options are allowed on the same line; thus I believe there is a bug. For example, the following config parses just fine:

noipv6rs
denyinterfaces !(ixl2)
allowinterfaces ixl2
script ""
link_rcvbuf 65536
interface ixl2
	duid
	fqdn disable
	iaid 0
	ia_na 0
	ia_pd 0/::/60 -
	ipv6rs
	# DHCPv6 options to remove. Copy-pasted from `dhcpcd -V` with `dhcp6_` prepended per `dhcpcd.conf(5)`.
	nooption dhcp6_name_servers,dhcp6_domain_search,dhcp6_sntp_servers,dhcp6_fqdn,dhcp6_posix_timezone,dhcp6_tzdb_timezone,dhcp6_ntp_server
	# ND options to remove. Copy-pasted from `dhcpcd -V` with `nd_` prepended per `dhcpcd.conf(5)`.
	nooption nd_mtu,nd_rdnss,nd_dnssl
	# DHCP options to remove. Copy-pasted from `dhcpcd -V`.
	nooption time_offset,time_servers,ien116_name_servers,domain_name_servers,host_name,domain_name,interface_mtu,ntp_servers,fqdn,posix_timezone,tzdb_timezone,name_service_search,domain_search
	# DHCPv6 options to request. Copy-pasted from `dhcpcd -V` with `dhcp6_` prepended per `dhcpcd.conf(5)`.
	option dhcp6_rapid_commit
	# DHCP options to request. Copy-pasted from `dhcpcd -V`.
	option rapid_commit
	persistent
	# DHCPv6 options to require. Copy-pasted from `dhcpcd -V` with `dhcp6_` prepended per `dhcpcd.conf(5)`.
	require dhcp6_server_id
	# DHCP options to require. Copy-pasted from `dhcpcd -V`.
	require dhcp_message_type,dhcp_server_identifier
	waitip 64

On the other hand, if you merge the two require lines (i.e., require dhcp6_server_id,dhcp_message_type,dhcp_server_identifier), dhcpcd(8) logs an "unknown option" error:

May 10 10:28:56 router dhcpcd[44420]: unknown option: dhcp6_server_id,dhcp_message_type,dhcp_server_identifier

Similarly, if you merge the three nooption lines:

⋮
	nooption dhcp6_name_servers,dhcp6_domain_search,dhcp6_sntp_servers,dhcp6_fqdn,dhcp6_posix_timezone,dhcp6_tzdb_timezone,dhcp6_ntp_server,nd_mtu,nd_rdnss,nd_dnssl,time_offset,time_servers,ien116_name_servers,domain_name_servers,host_name,domain_name,interface_mtu,ntp_servers,fqdn,posix_timezone,tzdb_timezone,name_service_search,domain_search
⋮

dhcpcd(8) logs an "unknown option" error:

May 10 10:28:56 router dhcpcd[44420]: unknown option: dhcp6_name_servers,dhcp6_domain_search,dhcp6_sntp_servers,dhcp6_fqdn,dhcp6_posix_timezone,dhcp6_tzdb_timezone,dhcp6_ntp_server,nd_mtu,nd_rdnss,nd_dnssl,time_offset,time_servers,ien116_name_servers,domain_name_servers,host_name,domain_name,interface_mtu,ntp_servers,fqdn,posix_timezone,tzdb_timezone,name_service_search,domain_search

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions