Project

General

Profile

Bug #13062

smart-proxy throws an error when the field for fixed-address does not match a valid IP.

Added by Tony Scheffer over 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DHCP
Target version:
Difficulty:
easy
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When doing the following;

host host.domain {
hardware ethernet 00:01:02:84:12:ab;
fixed-address host1.sub.domain.com;
}

using a hostname instead of an IP, ruby breaks, shown below.
Al tough this is bad practise, I guess a simple regex check should happen before parsing it.

E, [2016-01-08T09:21:44.417704 #4096] ERROR -- : invalid address
D, [2016-01-08T09:21:44.417833 #4096] DEBUG -- : /usr/lib/ruby/1.8/ipaddr.rb:517:in `in6_addr'
/usr/lib/ruby/1.8/ipaddr.rb:477:in `initialize'
/usr/share/foreman-proxy/modules/dhcp/subnet.rb:28:in `new'
/usr/share/foreman-proxy/modules/dhcp/subnet.rb:28:in `include?'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:44:in `find_subnet'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:43:in `each'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:43:in `find_subnet'


Related issues

Has duplicate Smart Proxy - Bug #13094: Not able to list DHCP records for a particular subnet through DHCP SmartProxy APIDuplicate2016-01-08

Associated revisions

Revision 31ab121a (diff)
Added by Dominic Cleal over 3 years ago

fixes #13062 - handle missing or non-IP fixed-address ISC fields

History

#1 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 104

#2 Updated by Tony Scheffer over 3 years ago

I assume this is related;

When using the following entry;

host test.domain {
hardware ethernet 00:50:56:84:30:63;
}

It also fails. This is actually valid when you combine this with 'deny unknown-clients'.

Failure;

E, [2016-01-08T12:31:56.591646 #4096] ERROR -- : address family must be specified
D, [2016-01-08T12:31:56.591769 #4096] DEBUG -- : /usr/lib/ruby/1.8/ipaddr.rb:451:in `initialize'
/usr/share/foreman-proxy/modules/dhcp/subnet.rb:28:in `new'
/usr/share/foreman-proxy/modules/dhcp/subnet.rb:28:in `include?'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:44:in `find_subnet'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:43:in `each'
/usr/share/foreman-proxy/modules/dhcp/subnet_service.rb:43:in `find_subnet'
/usr/share/foreman-proxy/modules/dhcp/providers/server/isc.rb:86:in `parse_config_and_leases_for_records'

#3 Updated by Dominic Cleal over 3 years ago

  • Priority changed from Low to Normal

#4 Updated by Dominic Cleal over 3 years ago

  • Has duplicate Bug #13094: Not able to list DHCP records for a particular subnet through DHCP SmartProxy API added

#5 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#6 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/357 added

#7 Updated by Dominic Cleal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF