bpo-28009: for AIX correct uuid.getnode() and add ctypes() based uuid._generate_time_safe by aixtools · Pull Request #5183 · python/cpython (original) (raw)

Please excuse the wall of examples.

On 6/4/2018 7:37 AM, Victor Stinner wrote: _uuid is fixed in AIX 6.1 and later, but not in AIX 5.3 as AIX 5.3 does not have uuid_create() in libc.

Currently all versions of AIX rely on netstat -i processing (Python2 and Python3) as the _uuid fix is only in Python3.7.

What is available on AIX 5.3?

As AIX 5.3 (and all earlier versions) lack uuid support, AIX depends on the output of netstat -i to get the mac address of the current system. Currently, the implementation is wrong because of the search for the colon (':') character. DETAILS/Examples FYI: arp -an can return the MAC address of a remote system, but not itself - and this does use the colon. Maybe this is the origin of the confusion. $ arp -an ... ? (192.168.129.61) at 0:14:5e:c7:f:ca [ethernet] stored in bucket 132 ... ifconfig does not return/show the local mac addresses - only IP addresses and netmask $ ifconfig -a en0: flags=1e084863,14c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN> inet 192.168.129.71 netmask 0xffffff00 broadcast 192.168.129.255 inet 192.168.90.71 netmask 0xffffff00 broadcast 192.168.90.255 tcp_sendspace 262144 tcp_recvspace 262144 tcp_nodelay 1 rfc1323 1 en1: flags=1e084863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 tcp_sendspace 262144 tcp_recvspace 262144 rfc1323 1 lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN> inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1%1/0 tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 netstat -ia does return a value with the ':' character, but it is a constant for all interfaces, on all systems. Not very "unique" ;) netstat -ia Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 fa.d1.8c.f7.62.4 1850055300 0 798079082 0 0 01:00:5e:00:00:01 en0 1500 192.168.129 x071 1850055300 0 798079082 0 0 224.0.0.1 en0 1500 192.168.90 x071 1850055300 0 798079082 0 0 224.0.0.1 en1 1500 link#3 fa.d1.8c.f7.62.5 35247637 0 53006985 0 0 01:00:5e:00:00:01 en1 1500 192.168.2 mail.aixtools.co 35247637 0 53006985 0 0 224.0.0.1 lo0 16896 link#1 994536 0 994536 0 0 lo0 16896 127 loopback 994536 0 994536 0 0 224.0.0.1 lo0 16896 loopback 994536 0 994536 0 0 $ dsh -a netstat -ia | egrep ":[0-9a-f]:" | sort -u x061: ff02::1:ff00:1 x062: ff02::1:ff00:1 x063: ff02::1:ff00:1 x064: ff02::1:ff00:1 x065: ff02::1:ff00:1 x066: ff02::1:ff00:1 x067: ff02::1:ff00:1 x068: ff02::1:ff00:1 x069: ff02::1:ff00:1 x070: ff02::1:ff00:1 x071: ff02::1:ff00:1 x072: ff02::1:ff00:1 Using the '.' character both netstat -i and netstat -ia return the same "layout". michael@x071:[/home/michael]dsh -a netstat -ia | egrep "link#.*[0-9a-f]+\." | sort x061: en0 1500 link#2 0.14.5e.c7.f.ca 2956249 0 3155401 3 0 x061: en1 1500 link#3 0.14.5e.c7.f.cb 480103254 0 257084859 4 0 x062: en0 1500 link#2 0.21.5e.a3.c7.42 7764939 0 4283174 0 0 x063: en1 1500 link#2 fa.d1.86.d4.97.4 9173264 0 8472320 0 0 x064: en0 1500 link#2 0.21.5e.a3.c7.44 881980 0 411142 0 0 x065: en0 1500 link#2 fa.d1.86.33.4c.4 1741169 0 1089608 0 0 x066: en0 1500 link#2 0.21.5e.a3.c7.46 27372 0 20396 0 0 x067: en0 1500 link#2 0.21.5e.a3.c7.47 756960 0 464111 0 0 x068: en0 1500 link#2 fa.d1.84.d3.9.4 630782 0 334713 0 0 x069: en0 1500 link#2 fa.d1.80.7.9b.4 588838 0 319134 0 0 x070: en0 1500 link#2 fa.d1.86.86.1d.4 557284 0 290822 0 0 x071: en0 1500 link#2 fa.d1.8c.f7.62.4 1850118244 0 798131868 0 0 x071: en1 1500 link#3 fa.d1.8c.f7.62.5 35252897 0 53013662 0 0 x072: en0 1500 link#2 fa.d1.83.60.33.4 600408 0 325491 0 0 michael@x071:[/home/michael]dsh -a netstat -i | egrep "link#.*[0-9a-f]+\." | sort x061: en0 1500 link#2 0.14.5e.c7.f.ca

2956310

0 3155453 3 0 x061: en1 1500 link#3 0.14.5e.c7.f.cb 480104733 0 257085779 4 0 x062: en0 1500 link#2 0.21.5e.a3.c7.42 7764998 0

4283220

0 0 x063: en1 1500 link#2 fa.d1.86.d4.97.4 9173365 0 8472407 0 0 x064: en0 1500 link#2 0.21.5e.a3.c7.44 882009 0 411160 0 0 x065: en0 1500 link#2 fa.d1.86.33.4c.4

1741205

0

1089631

0 0 x066: en0 1500 link#2 0.21.5e.a3.c7.46 27407 0 20420 0 0 x067: en0 1500 link#2 0.21.5e.a3.c7.47 756989 0 464128 0 0 x068: en0 1500 link#2 fa.d1.84.d3.9.4 630818 0 334738 0 0 x069: en0 1500 link#2 fa.d1.80.7.9b.4 588867 0 319152 0 0 x070: en0 1500 link#2 fa.d1.86.86.1d.4 557312 0 290839 0 0 x071: en0 1500 link#2 fa.d1.8c.f7.62.4 1850119720 0 798133182 0 0 x071: en1 1500 link#3 fa.d1.8c.f7.62.5 35253076 0 53013825 0 0 x072: en0 1500 link#2 fa.d1.83.60.33.4 600436 0 325508 0 0