Bug 682365

Summary: assumes all ethernet devices are named ethX
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: hhorak, matt_domsch, rvokal, tgl, the.ridikulus.rat
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mysql-5.5.18-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 682366 (view as bug list) Environment:
Last Closed: 2011-12-02 21:27:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 682334, 682366    
Attachments:
Description Flags
proposed patch that creates a "sum" of all interfaces
none
proposed patch that takes the first non-zero HW address none

Description Bill Nottingham 2011-03-05 00:12:58 UTC
Description of problem:

Network devices can have arbitrary names, and due to
http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming, will have
different names in Fedora 15.

my_gethwaddr.c:

  strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);

  do
  {
    if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
    {
      memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
      res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
    }
  } while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6');

Now, since this is only used to initialize the UUID (afaict), and there is fallback code for that, it may not be critical to fix this. Filing for completeness.

Version-Release number of selected component (if applicable):

mysql-5.5.8

How reproducible:

By inspection.

Comment 1 Tom Lane 2011-03-05 01:01:27 UTC
[ raised eyebrow... ]  Changing that naming convention is going to break boatloads of stuff, much of it user-written scripts that we couldn't fix if we wanted to.  You *sure* this is a good idea?

Comment 2 Matt Domsch 2011-03-05 01:27:32 UTC
Tom: yes.  The feature page describes how to disable the new naming convention, but the approved feature is enabled by default in F15.

Comment 3 Honza Horak 2011-10-24 16:27:59 UTC
Created attachment 529924 [details]
proposed patch that creates a "sum" of all interfaces

Since hw address is needed only for initiate a seed for pseudo-random number generator, we can return a value, that is unique enough to the machine, rather then the mac address. This patch loops through all interfaces and creates byte-by-byte sum of all devices. 

If real hw address should be returned, we'd need find out if the interface is a real one or just a virtual (loopback, virtual bridge, ...). One way (not sure how reliable it is) is compare the address with 00:00:00:00:00:00, since virtual interfaces seems to have zero address.

Comment 4 Honza Horak 2011-11-01 11:52:22 UTC
Created attachment 531117 [details]
proposed patch that takes the first non-zero HW address

Since there is a comment in mysys/my_gethwaddr.c, that we can use any of non-zero HW address, this patch fixes the issue that way. 

The patch has also been sent to upstream: http://bugs.mysql.com/bug.php?id=63055

Comment 5 Tom Lane 2011-11-15 13:44:15 UTC
Since this bug is against F15, I was planning to keep it open until the patch can be back-patched.  That's waiting on some other stuff though ...

Comment 6 Fedora Update System 2011-11-22 05:44:54 UTC
mysql-5.5.18-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mysql-5.5.18-1.fc15

Comment 7 Fedora Update System 2011-11-23 01:03:58 UTC
Package mysql-5.5.18-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mysql-5.5.18-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16293/mysql-5.5.18-1.fc15
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2011-12-02 21:27:10 UTC
mysql-5.5.18-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.