[#207] Reject 0.0.0.0 from netdisco-do device or renumber
This commit is contained in:
@@ -9,15 +9,16 @@
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* show page and total records number on DataTables tables
|
||||
* be more strict about Node Search matching ports/wifi within date range
|
||||
* allow filtering out of Device Ports on Node (MAC) search
|
||||
* display Voice VLAN on Cisco devices
|
||||
* Show page and total records number on DataTables tables
|
||||
* Be more strict about Node Search matching ports/wifi within date range
|
||||
* Allow filtering out of Device Ports on Node (MAC) search
|
||||
* Display Voice VLAN on Cisco devices
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* only exclude discover_no on Undiscovered Neighbors report when few (<50) results
|
||||
* mention expire in netdisco-do docs
|
||||
* Only exclude discover_no on Undiscovered Neighbors report when few (<50) results
|
||||
* Mention expire in netdisco-do docs
|
||||
* [#207] Reject 0.0.0.0 from netdisco-do device or renumber
|
||||
|
||||
2.031012 - 2015-02-28
|
||||
|
||||
|
||||
@@ -159,8 +159,10 @@ unless ($action) {
|
||||
return ('error', 'Missing device (-d).') if !defined $device;
|
||||
my $old_ip = $device->ip;
|
||||
|
||||
my $new_ip = NetAddr::IP::Lite->new($extra)
|
||||
or return ('error', "Bad host or IP: $extra");
|
||||
my $new_ip = NetAddr::IP::Lite->new($extra);
|
||||
unless ($new_ip and $new_ip->addr ne '0.0.0.0') {
|
||||
return ('error', "Bad host or IP: ".($extra || '0.0.0.0'));
|
||||
}
|
||||
my $new_dev = get_device($new_ip->addr);
|
||||
unless ($new_dev and not $new_dev->in_storage) {
|
||||
return ('error', sprintf "Already know new device: %s.", $device->ip);
|
||||
@@ -214,7 +216,7 @@ if (not $worker->can( $action )) {
|
||||
}
|
||||
|
||||
my $net = NetAddr::IP->new($device);
|
||||
if ($device and (!$net or $net->num == 0)) {
|
||||
if ($device and (!$net or $net->num == 0 or $net->addr eq '0.0.0.0')) {
|
||||
info sprintf '%s: error - Bad host, IP or prefix: %s', $action, $device;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user