Project

General

Profile

Bug #7233

Status DHCP Leases can have incorrect index for edit action

Added by Phillip Davis 8 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
DHCP Server
Target version:
Start date:
02/07/2017
Due date:
% Done:

100%

Affected version:
All
Affected Architecture:

Description

Forum: https://forum.pfsense.org/index.php?topic=125180.0

In the past, somehow (and I have seen it on systems of mine) it has been possible to end up with an empty row of data in the "DHCP Static Mappings for this Interface" in Services->DHCP. I am unable to replicate how this happens, I tried on VMs of systems back to 2.3-RELEASE with no "luck".

When this happens, Status->DHCP Leases correctly does not show the empty entry. But it does get the array index for subsequent entries wrong. So if you click the edit button to edit the entry for a row, it takes you to the wrong entry.

That can easily be fixed.

From Services->DHCP Server, such entries cannot be deleted. I think the underlying delete code only actually performs the delete if the entry is non-empty. I guess that should be fixed also.

Ideally it would be good to find how this can occur in the first place. Once understood, then that can be fixed (if still a bug in current code) and an upgrade step put in place to cleanup empty entries.

Associated revisions

Revision 2ea70e1a
Added by Phillip Davis 8 months ago

Part Fix #7233 Allow deletion of empty static map entries

Revision c940afee
Added by Phillip Davis 8 months ago

Part Fix #7233 Allow deletion of empty static map entries
(cherry picked from commit 2ea70e1a474fd871a007c76841f2a33f34082c58)

Revision 9aa3c5e8
Added by Phillip Davis 8 months ago

Part fix #7233 keep correct staticmap_array_index

The index needs to be incremented even for entries that were skipped for display because they (for whatever reason) have no MAC or CID set. So use the key directly from the array.

Revision 310f4f21
Added by Phillip Davis 8 months ago

Part fix #7233 keep correct staticmap_array_index

The index needs to be incremented even for entries that were skipped for display because they (for whatever reason) have no MAC or CID set. So use the key directly from the array.
(cherry picked from commit 9aa3c5e84984958caa19ac76ecba849b94a8b360)

History

#1 Updated by Phillip Davis 8 months ago

Pull Request https://github.com/pfsense/pfsense/pull/3505 to make sure the index counter in status_dhcp_leases keeps count correctly even if it skips over "blank" entries.

#2 Updated by Phillip Davis 8 months ago

PR https://github.com/pfsense/pfsense/pull/3506 will let people delete an empty entry, if they get one somehow.

#3 Updated by Phillip Davis 8 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#4 Updated by Jim Pingle 7 months ago

  • Target version changed from 2.4.0 to 2.3.3

#5 Updated by Renato Botelho 7 months ago

  • Status changed from Feedback to Resolved

works

Also available in: Atom PDF