Skip to content

Commit

Permalink
Store all parsed data into configuration
Browse files Browse the repository at this point in the history
Currently much of this data is lost, but a dnsmasq-specific DHCP subnet
class would solve that issue
  • Loading branch information
ananace committed Apr 28, 2020
1 parent b42eeac commit e329ddb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/smart_proxy_dhcp_dnsmasq/dhcp_dnsmasq_subnet_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def parse_config_for_subnets
data.merge! \
interface: subnet_iface ? subnet_iface.name : nil,
address: IPAddr.new("#{start_addr}/#{mask}").to_s,
broadcast: broadcast,
mask: mask,
mode: mode,
range: [start_addr.to_s, end_addr].compact,
ttl: ttl

Expand Down Expand Up @@ -167,7 +169,7 @@ def parse_config_for_subnets
end

configuration.each do |id, data|
logger.debug "Adding subnet #{id} with configuration; #{data}"
logger.debug "Parsed subnet #{id} (#{data[:address]}) with configuration; #{data}"
subnets << ::Proxy::DHCP::Subnet.new(data[:address], data[:mask], data[:options])
end

Expand Down

0 comments on commit e329ddb

Please sign in to comment.