File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/smart_proxy_dhcp_dnsmasq Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ def parse_config_for_subnets
91
91
92
92
next if start_addr . ipv6? # Smart-proxy currently doesn't support IPv6
93
93
94
- logger . warning "Failed to fully parse line #{ file } :#{ line_nr } : '#{ line } ', remaining data: #{ data . inspect } " unless data . empty?
94
+ logger . warning "Failed to fully parse line #{ file } :#{ line_nr } : '#{ line } ', unparsed data: #{ data . inspect } " unless data . empty?
95
95
96
96
ipv4 = start_addr . ipv4?
97
97
subnet_iface = interfaces . find { |i | ( ipv4 ? i . addr . ipv4? : i . addr . ipv6? ) && i . name == subnet_iface } if subnet_iface
@@ -146,9 +146,13 @@ def parse_config_for_subnets
146
146
( data . first if interfaces . find { |i | i . name == data . first } ) ||
147
147
configuration . keys
148
148
149
- data . shift until data . empty? || /\A \d + \z / =~ data . first
149
+ data . shift until data . empty? || /^ \d +|option6?: \w +$ / =~ data . first
150
150
next if data . empty?
151
151
152
+ unless data . first =~ /^\d +$/
153
+ logger . warning "Found non-numeric DHCP option on line #{ file } :#{ line_nr } : '#{ line } ', skipping."
154
+ next
155
+ end
152
156
code = data . shift . to_i
153
157
154
158
option = ::Proxy ::DHCP ::Standard . select { |_k , v | v [ :code ] == code } . first . first
You can’t perform that action at this time.
0 commit comments