Skip to content

getmac incorrectly formats MAC address? #82

@tonycassara

Description

@tonycassara

Describe the bug
When trying to grab the MAC address for my wireless TV device, the getmac command returns the wrong address. Let's say my actual address is 30:7b:45:3b:02:6c but then getmac returns 03:07:b4:53:b2:6c. I believe it is removing the leading zero from the 2nd to last tuple and appending another leading zero to the front of the address. The format returned by getmac is invalid with the application I'm using wakeonlan it wants the first address.

To Reproduce
Run arp -a on your network and find an address with a leading zero tuple (it will probably appear to be a single digit e.g. 2 vs 02). Then use getmac on that same IP address. It seems pretty consistent that it appends a leading zero to the entire MAC address, regardless of where the digit is missing.

Expected behavior
I believe it should have appended the leading zero to the 2nd to last tuple in my example above. The reality is I know next to nothing about MAC addresses so if I'm incorrect someone please educate me :)

System info
(please complete the following information):

  • OS name: Mac OS Ventura
  • OS Version: 13.2
  • Python version: 3.10
  • getmac version: 0.9.1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions