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

_ipconfig_getnode incorrectly selects a DUID as a MAC address #77723

Closed
CtrlZvi mannequin opened this issue May 16, 2018 · 6 comments
Closed

_ipconfig_getnode incorrectly selects a DUID as a MAC address #77723

CtrlZvi mannequin opened this issue May 16, 2018 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@CtrlZvi
Copy link
Mannequin

CtrlZvi mannequin commented May 16, 2018

BPO 33542
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba, @miss-islington, @CtrlZvi
PRs
  • bpo-33542: Ignore DUID in uuid.get_node on Windows #6922
  • [3.7] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) #7011
  • [3.6] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) #7014
  • [2.7] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) #7015
  • 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:

    assignee = None
    closed_at = <Date 2018-05-21.12:43:15.155>
    created_at = <Date 2018-05-16.16:20:56.106>
    labels = ['3.7', '3.8', 'type-bug', 'library', 'OS-windows']
    title = '_ipconfig_getnode incorrectly selects a DUID as a MAC address'
    updated_at = <Date 2018-05-21.12:43:15.148>
    user = 'https://github.com/CtrlZvi'

    bugs.python.org fields:

    activity = <Date 2018-05-21.12:43:15.148>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-05-21.12:43:15.155>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2018-05-16.16:20:56.106>
    creator = 'zeffron'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33542
    keywords = ['patch']
    message_count = 6.0
    messages = ['316831', '317174', '317181', '317204', '317231', '317232']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'miss-islington', 'zeffron']
    pr_nums = ['6922', '7011', '7014', '7015']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33542'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @CtrlZvi
    Copy link
    Mannequin Author

    CtrlZvi mannequin commented May 16, 2018

    The function _ipconfig_getnode() in the uuid module can incorrectly pick up an IPv6 DUID instead of a MAC address due to not validating an exact match for the regular expression. The following output from ipconfig /all on my machine can be used to illustrate the problem:

    C:\Users\viz_s>ipconfig /all
    
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : DESKTOP-UOHALF9
       Primary Dns Suffix  . . . . . . . :
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
    
    Ethernet adapter vEthernet (Default Switch):
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
       Physical Address. . . . . . . . . : 02-15-0B-EF-A2-34
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::d8b5:2fbd:4d82:2e95%12(Preferred)
       IPv4 Address. . . . . . . . . . . : 192.168.125.17(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.240
       Default Gateway . . . . . . . . . :
       DHCPv6 IAID . . . . . . . . . . . : 452990301
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-5A-B1-27-98-5F-D3-C5-71-45
       DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                           fec0:0:0:ffff::2%1
                                           fec0:0:0:ffff::3%1
       NetBIOS over Tcpip. . . . . . . . : Disabled
    
    Ethernet adapter vEthernet (DockerNAT):
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2
       Physical Address. . . . . . . . . : 00-15-5D-00-0D-1C
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::a8b0:4970:fe5c:7ad8%20(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.0.75.1(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :
       DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                           fec0:0:0:ffff::2%1
                                           fec0:0:0:ffff::3%1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    
    Ethernet adapter Npcap Loopback Adapter:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Npcap Loopback Adapter
       Physical Address. . . . . . . . . : 02-00-4C-4F-4F-50
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::c07f:d604:86b:87e0%26(Preferred)
       Autoconfiguration IPv4 Address. . : 169.254.135.224(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.0.0
       Default Gateway . . . . . . . . . :
       DHCPv6 IAID . . . . . . . . . . . : 771883084
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-5A-B1-27-98-5F-D3-C5-71-45
       DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                           fec0:0:0:ffff::2%1
                                           fec0:0:0:ffff::3%1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    
    Wireless LAN adapter Local Area Connection* 2:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
       Physical Address. . . . . . . . . : 9A-5F-D3-C5-70-44
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
    
    Wireless LAN adapter Local Area Connection* 12:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter #2
       Physical Address. . . . . . . . . : 9A-5F-D3-C5-75-44
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
    
    Wireless LAN adapter Wi-Fi:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Marvell AVASTAR Wireless-AC Network Controller
       Physical Address. . . . . . . . . : 98-5F-D3-C5-71-45
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::f183:815e:4914:dfa%21(Preferred)
       IPv4 Address. . . . . . . . . . . : 100.69.161.39(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.0.0
       Lease Obtained. . . . . . . . . . : Wednesday, May 16, 2018 8:51:32 AM
       Lease Expires . . . . . . . . . . : Wednesday, May 16, 2018 9:51:31 AM
       Default Gateway . . . . . . . . . : 100.69.0.5
       DHCP Server . . . . . . . . . . . : 100.69.0.6
       DHCPv6 IAID . . . . . . . . . . . : 144203731
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-5A-B1-27-98-5F-D3-C5-71-45
       DNS Servers . . . . . . . . . . . : 100.69.0.5
       NetBIOS over Tcpip. . . . . . . . : Enabled
    

    @CtrlZvi CtrlZvi mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir OS-windows type-bug An unexpected behavior, bug, or error labels May 16, 2018
    @serhiy-storchaka
    Copy link
    Member

    New changeset c66c342 by Serhiy Storchaka (CtrlZvi) in branch 'master':
    bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
    c66c342

    @miss-islington
    Copy link
    Contributor

    New changeset 073eca3 by Miss Islington (bot) in branch '3.7':
    bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
    073eca3

    @serhiy-storchaka
    Copy link
    Member

    New changeset ea9a099 by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) (GH-7015)
    ea9a099

    @serhiy-storchaka
    Copy link
    Member

    New changeset e9e2fd7 by Serhiy Storchaka in branch '3.6':
    [3.6] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) (GH-7014)
    e9e2fd7

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your contribution Zvi!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants