Project

General

Profile

Bug #25769

ISC DHCP parser fails to parse custom DHCP option

Added by J. A. 11 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Category:
DHCP
Target version:
-
Difficulty:
easy
Triaged:
Yes
Bugzilla link:

Description

In dhcpd.conf I include the following line:

option voip-tftp-server code 150 = { ip-address };

This uses dhcpd's functionality for defining custom options (see the "DEFINING NEW OPTIONS" section in man page dhcp-options(5) for a description of the syntax). In this case it defines Cisco's proprietary option 150 for loading IP phone configuration from a TFTP server.

The dhcp_isc provider fails to parse it with the following error message and trace:

2019-01-03T11:11:06  [E] Couldn't enable 'dhcp_isc': 
in /etc/dhcp/dhcpd.conf:19 at 49, expect token [ keyword_server_duid ]
oip-tftp-server code 150 = { ip-address };
                                                 ^
2019-01-03T11:11:06  [D] <Array> ["/usr/lib/ruby/vendor_ruby/rsec/parser.rb:19:in `parse!'", "/usr/share/foreman-proxy/modules/dhcp_common/isc/configuration_parser.rb:441:in `subnets_hosts_and_lea
ses'", "/usr/share/foreman-proxy/modules/dhcp_common/isc/subnet_service_initialization.rb:11:in `load_configuration_file'", "/usr/share/foreman-proxy/modules/dhcp_isc/isc_state_changes_observer.rb
:152:in `load_configuration_file'", "/usr/share/foreman-proxy/modules/dhcp_isc/isc_state_changes_observer.rb:129:in `block in do_start'", "/usr/share/foreman-proxy/modules/dhcp_common/subnet_service.rb:154:in `block in group_changes'", "/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'", "/usr/share/foreman-proxy/modules/dhcp_common/subnet_service.rb:154:in `group_changes'", "/usr/share/foreman-proxy/modules/dhcp_isc/isc_state_changes_observer.rb:128:in `do_start'", "/usr/share/foreman-proxy/modules/dhcp_isc/isc_state_changes_observer.rb:80:in `start'", "/usr/share/foreman-proxy/modules/dhcp_isc/inotify_leases_file_observer.rb:42:in `start'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:238:in `block in start_services'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:236:in `each'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:236:in `start_services'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:221:in `configure_plugin'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:92:in `block in configure'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:92:in `each'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:92:in `configure'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:170:in `block in initialize_plugins'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:170:in `each'", "/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:170:in `initialize_plugins'", "/usr/share/foreman-proxy/lib/launcher.rb:168:in `launch'", "/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'"]

This causes the DHCP module of the smart proxy to fail to load; this started happening when upgrading from Foreman 1.17 to Foreman 1.20 (through the intermediary major versions) while the dhcpd.conf was the same throughout, so I guess this is a regression caused by switching to new code?

Is there a workaround for this regression? Can I downgrade the DHCP-serving smart proxy and keep Foreman at 1.20?

Associated revisions

Revision c4b94cb2 (diff)
Added by Lukas Zapletal 11 months ago

Fixes #25769 - dhcp conf parser option code fixed

History

#1 Updated by Lukas Zapletal 11 months ago

  • Triaged changed from No to Yes
  • Difficulty set to easy

No workaround, parser code change needed to support that.

#2 Updated by Lukas Zapletal 11 months ago

I hope to find time for this, in case I am not getting to this, the fix should be similar as this one: https://github.com/theforeman/smart-proxy/pull/616/files

#3 Updated by The Foreman Bot 11 months ago

  • Assignee set to Lukas Zapletal
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/632 added

#4 Updated by J. A. 11 months ago

Thanks a lot, Lukas!

#5 Updated by Anonymous 11 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Tomer Brisker 8 months ago

  • Fixed in Releases 1.22.0 added

Also available in: Atom PDF