Skip to content

issue#453, feature#455: Open IP Addresses from IP Ranges with the Most Recent scan; add Virtual/KVM Host for 52:54:00 - #454

Merged
TheWitness merged 3 commits into
developfrom
fix/mactrack-ip-range-scan-date
Nov 17, 2026
Merged

TheWitness merged 3 commits into
developfrom
fix/mactrack-ip-range-scan-date

Conversation

@TheWitness

@TheWitness TheWitness commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #453 and fixes #455.

IP Ranges drill-down to IP Addresses (#453)

The View IP Addresses link on IP Ranges (mactrack_view_ips.php) passed &scan_date=3. The IP Addresses report only knows 1 (All), 2 (Most Recent) and a literal scan date, so 3 was read as the scan date "3": the report showed no rows and its Scan Date filter had nothing selected. The link now passes &scan_date=2, so it opens with Most Recent selected, which is also the report's default.

scan_date=3 stays on the View MAC Addresses links (IP Ranges, Sites, Devices): in the MAC Addresses report 3 is Aggregated. Only the IP Addresses link was wrong. The Sites view links to the IP Addresses report without a scan date, so it already got the default.

Virtual/KVM Host for the 52:54:00 vendor MAC (#455)

52:54:00 is the prefix QEMU/KVM gives its virtual network cards. No vendor has registered it with the IEEE, so no OUI list holds it and those MAC addresses showed no vendor. mactrack_ensure_known_vendor_macs() adds the record 525400 = Virtual/KVM Host to mac_track_oui_database (stored without separators, as the import stores them):

  • on upgrade: mactrack_perform_upgrade() runs it once the migrations have finished, so an upgrade that has to be retried adds nothing until it completes;
  • after every IEEE import: import_oui_database() runs it after the write and the delete of the vendors the list did not refresh. A full import deletes every vendor it did not refresh, so without this the record would disappear on the next import. This covers the full list, the partial fallback list and a failed batch.

It uses INSERT IGNORE, so a prefix the table already holds, for example one the IEEE registers later, is kept. The prefixes live in the MACTRACK_KNOWN_VENDOR_MACS constant, keyed as the table stores them; the helper casts the key to a string because PHP turns a numeric key such as 525400 into an integer.

Fresh installs are not seeded (the table is empty until the first import, which then adds the record).

Related Issue

#453, #455

Motivation and Context

Drilling down from an IP range to its addresses showed an empty report, and MACs from KVM guests showed no vendor.

How Has This Been Tested?

  • IpRangeDrilldownTest: the IP Addresses link uses 2 and that report offers Most Recent as 2 and has no 3; the MAC Addresses link uses 3 and that report offers Aggregated as 3; the IP Addresses report defaults to 2.
  • The upgrade test checks the record is added with ['525400', 'Virtual/KVM Host', ''] and not added by an upgrade that returns incomplete; MactrackOuiDownloadTest checks the record is added after the delete for a full, a partial and a failed import, and that an existing record is kept (INSERT IGNORE). The numeric-key cast was found by these tests.
  • Pest: 1102 tests pass; patch coverage 100%. I did not click through the pages or run a real IEEE import.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation repository accordingly.

#453)

The IP Ranges link passed scan_date=3, which the IP Addresses report reads as a
scan date and shows no rows for. 3 is only valid in the MAC Addresses report
(Aggregated). Pass 2, Most Recent, the report's default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 15:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the IP Ranges drill-down change.

No open issues 🎉

What changed in this PR

Fixes #453 by making the IP Ranges drill-down open the IP Addresses report with Most Recent selected instead of an unsupported scan-date value.

Changes:

  • Changes the IP Addresses link from scan_date=3 to scan_date=2, leaving MAC Addresses links unchanged.
  • Adds regression tests for drill-down scan values and the IP Addresses default.
  • Documents the fix in the changelog.
File Description
tests/​Unit/​IpRangeDrilldownTest.php Verifies IP and MAC drill-down scan values and the IP report default.
mactrack_view_ips.php Uses the Most Recent scan for the IP Addresses link.
CHANGELOG.md Records the fix for issue #453.

Review effort: Balanced

52:54:00 is the prefix QEMU/KVM gives its virtual network cards. No vendor has
registered it with the IEEE, so no OUI list holds it. Add it to the OUI
table when the plugin is upgraded and after every OUI import, because a full
import deletes the vendors the IEEE list does not hold. A prefix the table
already holds is kept.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TheWitness TheWitness changed the title issue#453: Open IP Addresses from IP Ranges with the Most Recent scan issue#453, feature#455: Open IP Addresses from IP Ranges with the Most Recent scan; add Virtual/KVM Host for 52:54:00 Nov 17, 2026
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 45ba906 into develop Nov 17, 2026
7 of 8 checks passed
@TheWitness
TheWitness deleted the fix/mactrack-ip-range-scan-date branch November 17, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants