OSSP CVS Repository

ossp - Ticket #190
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 190: v1 uuids not working on Linux or with MAC addrs with high-bit set

I can't get a v1 uuid on CentOS 6.2 or Fedora 16 with 1.6.2.

[philipp@builder ~]$ uuid -v1
639519c8-b019-11e1-9b4b-ff91eac3a44f
[philipp@builder ~]$ uuid -d `uuid -v1`
encode: STR: 6aed0654-b019-11e1-abf4-8f6127f75e13
SIV: 142128870312796779101177586876736298515
decode: variant: DCE 1.1, ISO/IEC 11578:1996
version: 1 (time and node based)
content: time: 2012-06-06 20:51:41.241506.0 UTC
clock: 11252 (usually random)
node: 8f:61:27:f7:5e:13 (local multicast)
[philipp@builder ~]$ ip -0 link show

  1. lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  2. p6p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:22:15:ba:83:bf brd ff:ff:ff:ff:ff:ff
    [philipp@builder ~]$

Also, note that when using NetworkManager, eth0 gets renamed as p6p1, so the Linux code won't find "eth0".

Looking at uuid.c:970:

    /*
     *  GENERATE NODE
     */

    if ((mode & UUID_MAKE_MC) || (uuid->mac[0] & BM_OCTET(1,0,0,0,0,0,0,0))) {

what is this code testing for in the right-hand side? Is it testing whether the MAC address was undiscovered? If so, you need to test all 6 octets, i.e.

!memcmp(uuid->mac, "\200\0\0\0\0\0", MAC_LEN)

instead.

If you're testing for a Multicast address, you want:

(uuid->mac[0] & IEEE_MAC_MCBIT)

instead.

[Append remarks]

Remarks:

2012-Jun-07 09:04:13 by anonymous:
Applied a fix here:

bugzilla.redhat.com/show_bug.cgi?id=829532

please note that configure (or configure.ac or one of its include files) needs to detect /usr/include/netpacket/packet.h on linux.


2013-Apr-12 19:25:19 by anonymous:
This is a trivial fix. Can we please get some movement on this? Thanks.


2013-May-30 21:16:49 by anonymous:
If there's a problem with the fix, can you please add a comment saying so that I may rework the patch?
[Append remarks]

Properties:

Type: code           Version: 1.6.2 
Status: new          Created: 2012-Jun-06 22:55
Severity:          Last Change: 2013-May-30 21:16
Priority:          Subsystem: uuid 
Assigned To: rse           Derived From:  
Creator: anonymous 

CVSTrac 2.0.1