Repository navigation
fix(): rebuild the SLAAC MAC address from the address bytes - #21
Merged
Merged
Conversation
An EUI-64 address whose last group starts with a zero answered HTTP 500 with an empty body: 2a01:cb05:801c:d01:be24:11ff:fee8:200 became the MAC bc:24:11:e8:20:0, which Mac rejects as invalid. The MAC was cut out of the compressed text form, so a dropped leading zero, a "::" in the interface id or an "fffe" outside bytes 11-12 shifted every pair after it. Reading bytes 8-10 and 13-15 of inet_pton() has none of these cases. PHPUnit comes in as a dev dependency to hold the regression test; `composer prod` now installs with --no-dev so the image does not ship it.
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.
An IPv6 SLAAC/EUI-64 address whose last group starts with a zero answered HTTP 500 with an empty body.
2a01:cb05:801c:d01:be24:11ff:fee8:200(a Proxmox guest, MACBC:24:11:E8:02:00) was turned into the MACbc:24:11:e8:20:0, whichMacrejects.?ip=<address>hit the same path.The MAC was cut out of the compressed text form of the address, so a dropped leading zero, a
::inside the interface id or anfffeoutside bytes 11-12 shifted every pair after it. It is now read from bytes 8-10 and 13-15 ofinet_pton(), with the universal/local bit flipped as before.PHPUnit 11 comes in as a dev dependency to hold the regression test (
composer test).composer prodnow installs with--no-devso the image does not ship it. CI does not run the test yet.Checked:
tests/Unit/Types/IPTest.php: 3 of 5 cases fail withInvalid MAC addressbefore the fix, 5/5 pass after.e7db/ifconfig:masterimage with the patchedIP.phpmounted:/txtfor the address above went from 500 to 200, and/jsonreportsBC:24:11:E8:02:00.apt-get(packages.sury.org) before any repository file is copied; this PR's build covers it.🤖 Generated with Claude Code