Repository navigation
fix(oui): keep vendors on partial downloads and keep the proxy with a login - #434
Merged
Merged
Conversation
… login The IEEE REST fallback returns at most 10000 of about 40500 assignments, but the import still marked every vendor absent and then deleted the ones the list did not contain. Retire vendors only when the full list was downloaded and it parsed to at least 1000 records, so an HTML error page served with a 200 status no longer empties the table either. Setting a proxy user replaced the whole stream context with only the Proxy-Authorization header, so the download skipped the proxy and sent the proxy login to the IEEE. Add the header to the proxy options instead, use a context for this download rather than the process-wide default, and bound each attempt to 30 seconds. The web import only flushed batches for the CLI caller, so it sent every record in one statement. Parse the listing first, then write in batches of 1000 for every caller. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
A failed REPLACE batch leaves the vendors it was meant to refresh marked absent, and the import then deleted every absent vendor. Skip the delete when any batch fails, mark the vendors present again, and log a warning. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
This was referenced Nov 13, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
TheWitness
approved these changes
Nov 13, 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 five defects in the OUI vendor database import (
import_oui_database()):services13.ieee.org/...registry=MA-L&format=txt) returns at most 10,000 of the roughly 40,500 MA-L assignments. When the primaryoui.txtdownload failed, the import still marked every vendor absent and then deleted the ones that list did not contain, so about three quarters of the vendors were removed. Vendors are now retired only when the full list was downloaded. A fallback import adds and refreshes entries and logs a NOTE.Proxy-Authorizationheader. The download then bypassed the proxy and sent the proxy login to the IEEE host. The header is now added to the proxy options. The download uses its own stream context instead of changing the process-wide default, and each attempt is limited to 30 seconds.REPLACEstatement. The listing is now parsed first bymactrack_parse_oui_database()and written in batches of 1,000 for every caller.REPLACEbatch fails, for example because it exceedsmax_allowed_packet, the import no longer deletes the vendors still marked absent, which would have included every vendor that batch was meant to refresh. It marks them present again and logs a WARNING.mactrack_download_oui_database()gains two optional parameters (the URL that returned the data, and a stream context), andimport_oui_database()gains an optional fallback URL so tests can use local fixtures. Existing callers are unchanged.How Has This Been Tested?
oui.txt(40,495 records), the extracted parser returns exactly the same records as the previous inline loop. The fallback URL returned exactly 10,000 records.php -lon PHP 8.1. php-cs-fixer reports no new findings in the changed code.Types of changes