Repository navigation
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
Conversation
#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>
Contributor
There was a problem hiding this comment.
🟢 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=3toscan_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>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
xmacan
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 knows1(All),2(Most Recent) and a literal scan date, so3was 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=3stays 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:00is 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 record525400= Virtual/KVM Host tomac_track_oui_database(stored without separators, as the import stores them):mactrack_perform_upgrade()runs it once the migrations have finished, so an upgrade that has to be retried adds nothing until it completes;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 theMACTRACK_KNOWN_VENDOR_MACSconstant, keyed as the table stores them; the helper casts the key to a string because PHP turns a numeric key such as525400into 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.['525400', 'Virtual/KVM Host', '']and not added by an upgrade that returns incomplete;MactrackOuiDownloadTestchecks 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.Types of changes
Checklist: