Bug 682365 - assumes all ethernet devices are named ethX
Summary: assumes all ethernet devices are named ethX
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 15
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Tom Lane
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 682334 682366
TreeView+ depends on / blocked
Reported: 2011-03-05 00:12 UTC by Bill Nottingham
Modified: 2014-03-17 03:26 UTC (History)
5 users (show)

Fixed In Version: mysql-5.5.18-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 682366 (view as bug list)
Last Closed: 2011-12-02 21:27:10 UTC
Type: ---

Attachments (Terms of Use)
proposed patch that creates a "sum" of all interfaces (1.72 KB, patch)
2011-10-24 16:27 UTC, Honza Horak
no flags Details | Diff
proposed patch that takes the first non-zero HW address (1.65 KB, patch)
2011-11-01 11:52 UTC, Honza Horak
no flags Details | Diff

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.


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

    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):


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.

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:
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.

Note You need to log in before you can comment on or make changes to this bug.