Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust MAC address matching #19750

Merged
merged 1 commit into from
Oct 14, 2024
Merged

More robust MAC address matching #19750

merged 1 commit into from
Oct 14, 2024

Commits on Oct 5, 2024

  1. More robust MAC address matching

    On darwin bootp uses non-standard MAC address format[1]:
    "8e:1:99:9c:54:b1" instead of "8e:01:99:9c:54:b1". We fixed this by
    trimming leading "0" in the string before looking up the IP address.
    
    There are several issues with the current code:
    - Fragile, will break if bootp changes the format (unlikely)
    - Fixing the wrong place, the drivers should not care about the MAC
      address format.
    - The tests were confusing, showing that we can match standard MAC
      addresses while the actual code could match only non-standard bootp
      addresses.
    - Logging wrong MAC address since we trimmed leading zeros before
      logging
    
    This change replace trimming leading zeros with parsing MAC address
    strings and comparing the bytes. The test includes now both standard and
    non-standard MAC addresses.
    
    [1] https://openradar.appspot.com/FB15382970
    nirs committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    92ebf0d View commit details
    Browse the repository at this point in the history