-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone #75824
Comments
Ethernet emulation for some devices like Android phones' tethering use all-zero MAC addresses (which is okay since they don't actually pass Ethernet frames to other NICs). This results in a node ID of 0 if I'm currently connected to the Net via such a device. Which fails range checks in the corresponding tests. RFC 4122 doesn't actually have any prohibitions of using a node ID of 0. Neither does IEEE 802.3 (or rather, whatever info I gathered on it since the standard's text is not freely available) assign any special meaning to an all-zero MAC address. The patch also corrects the check call in test_windll_getnode since the tested function always generates UUID from a MAC address. |
Example failure: ====================================================================== Traceback (most recent call last):
File "C:\Ivan\cpython\lib\test\test_uuid.py", line 501, in test_windll_getnode self.check_node(node)
File "C:\Ivan\cpython\lib\test\test_uuid.py", line 449, in check_node
"%s is not an RFC 4122 node ID" % hex)
AssertionError: False is not true : 000000000000 is not an RFC 4122 node ID ====================================================================== Traceback (most recent call last):
File "C:\Ivan\cpython\lib\test\test_uuid.py", line 296, in test_getnode
self.assertTrue(0 < node1 < (1 << 48), '%012x' % node1)
AssertionError: False is not true : 000000000000 |
On a Samsung device with Android 5.1 and tethering enabled, only one network device has a MAC address and it is not an all-zero MAC address. Ivan can you please provide more information about this problem: which device, what Android version, what is the output of 'ip link' ? |
I'm not sure that 000000000000 is better than a random address. Even if an all-zero MAC address is not explicitly prohibited it is used in a multiple independent devices. A random address looks more appropriate fore the purpose of generating a UUID. |
I agree, getnode() when obtained from a MAC address should not return 0. RFC 4122 states (emphasis on 'uniqueness' is mine): This document specifies three algorithms to generate UUIDs: the |
C:\> ipconfig -all DNS-суффикс этого подключения . . : Device name: Samsung Galaxy S7
|
So the all-zero MAC address occurs on a Windows box and that explains the test_windll_getnode failure (this test is skipped on Android). I missed that point in your initial post and knowing what Android device you are using is irrelevant. |
According to my tests, on Android API level 21, @encukou: So I think this issue can be closed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: