-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Mac address reporting is probably wrong on Linux #786
Comments
Mmm I don't know much about IPv6 addresses but perhaps '0b:6a:f2:c2' and '0b:6a:f2:c2:00:00' are the same? In that case this would be a test issue. |
Note that this is a HW address, not IPv6. It's probably not a MAC address either (sorry, I'm not an expert here) - it has link encap: unspec, not ethernet, so it's a different class. It's still a hardware address but the assumption that it's exactly 6 bytes is not valid. Maybe the correct solution here is to ignore encap unspec addresses entirely? |
Ah right sorry, it's a MAC address (I got confused). What about |
I should have fixed this. Can you try latest GIT version? |
Thanks, impressively fast response! Your commit fixed that one issue, I have another one though. Sorry, some of our machines have weird network setup: psutil mac output: eth0:00:1a:11:40:3a:e6 ifconfig -a: eth0 Link encap:Ethernet HWaddr 00:1a:11:40:3a:e6 so it seems like psutil loses information on gre0 and sixdecap0? in any case, the test function always gets exactly 6 bytes so the test passes for gre0 and sixdecap0 (even though psutil is probably wrong) but fails for ip6gre0 and ip6tnl0 where psutil agrees with ipconfig. The other bug was much more important than this small issue here now, thanks for fixing that one! |
Mmmm... but is that the actual |
Sent you a mail with more debugging info. Thanks for investigating this! |
Mmm.. it seems the problem only occurs with those |
Those look like virtual interfaces for tunneling (GRE, 6to4, etc). |
Yes, they probably are. Do you know what the correct value would be to report for HWaddr in that case? |
Matching the system tool such as ifconfig is probably best. |
Hey,
I'm trying to update to v4.0.0 and I get test failures for the test_net_if_addrs_ips test. This is the assertion error:
FAIL: test_net_if_addrs_ips (psutil.tests.test_linux.TestSystemNetwork)
Traceback (most recent call last):
File "psutil/tests/test_linux.py", line 334, in test_net_if_addrs_ips
self.assertEqual(addr.address, get_mac_address(name))
AssertionError: '0b:6a:f2:c2' != '0b:6a:f2:c2:00:00'
In ifconfig, the offending HWaddr looks like this:
Link encap:UNSPEC HWaddr 0B-6A-F2-C2-00-00-00-00-00-00-00-00-00-00-00-00
I'm not sure what the value should be but to me it seems that the test function returning "0b:6a:f2:c2:00:00" might be correct? In any case, it would be good if the two functions agreed :)
The text was updated successfully, but these errors were encountered: