Bug #2914

DHCP: can't modify IP reservation

Added by Giacomo Sanchietti almost 7 years ago. Updated almost 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-dnsmasq
Target version:v6.5
Security class: Resolution:
Affected version:v6.5-final NEEDINFO:No

Description

After creating an IP reservation, the entry can't be modified because the system raises the following validation error "08:00:27:77:C3:22".

Steps to reproduce
  • Create an IP reservation
  • Try to edit the reservation
  • The save action will fail
Expected behavior
  • It must be possibile to modify already existing reservations
  • The validator should work only for new records

Related issues

Related to NethServer 6 - Bug #3107: Cannot modify DHCP reservation CLOSED

Associated revisions

Revision 4ad3b3de
Added by Giacomo Sanchietti almost 7 years ago

Web UI: fix reserver-mac validator. Refs #2914

History

#1 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from NEW to TRIAGED
  • Target version set to v6.5
  • % Done changed from 0 to 20

Possible fix:

--- /etc/e-smith/validators/actions/mac-not-reserved.ori    2014-10-16 12:04:02.695294505 +0000
+++ /etc/e-smith/validators/actions/mac-not-reserved    2014-10-16 12:07:17.139231887 +0000
@@ -35,7 +35,8 @@
 my $db = esmith::HostsDB->open_ro();
 foreach ($db->get_all_by_prop('type' => 'local')) {
     my $used_mac = $_->prop('MacAddress');
-    if ($used_mac eq $mac) {
+    my $used_ip = $_->prop('IpAddress');
+    if ($used_mac eq $mac && $used_ip ne $ip) {
         exit 1;
     }
 }

#2 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#3 Updated by Giacomo Sanchietti almost 7 years ago

  • Assignee set to Giacomo Sanchietti

#4 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#5 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-dnsmasq-1.2.1-1.0git4ad3b3de.ns6.noarch.rpm
Test case 1
  • Create a new IP reservation
  • Try to change the Description inside the reservation
  • The validator must validate the input
Test case 2
  • Create a new IP reservation with an already assigned mac
  • The validator must fail

#6 Updated by Davide Principi almost 7 years ago

  • Assignee set to Davide Principi

#7 Updated by Davide Principi almost 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 70 to 90

VERIFIED

NOTE: the validation fails on test case 2, but the error tooltip points to the wrong field!

#8 Updated by Davide Principi almost 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-dnsmasq-1.3.0-1.ns6.noarch.rpm

#9 Updated by Davide Principi over 6 years ago

  • Related to Bug #3107: Cannot modify DHCP reservation added

Also available in: Atom PDF