<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - udev makes network interfaces available before it has renamed them"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=56929">56929</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>udev makes network interfaces available before it has renamed them
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dsd@laptop.org
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=69830" name="attach_69830" title="full journald log">attachment 69830</a> <a href="attachment.cgi?id=69830&action=edit" title="full journald log">[details]</a></span>
full journald log

Fedora 18 (systemd-195-2.fc18) running on OLPC XO laptops.

We ship a udev rule that renames eth* network interfaces when they are found.

   KERNEL=="eth*", PROGRAM="olpc_eth_namer", NAME="%c"

This rule is no longer working, the renames fail with error:

   systemd-udevd[258]: error changing net interface name eth0 to eth1: Device
or resource busy

The journalctl logs (attached) show that NetworkManager is activating the
device before udev rules have run. Here is the trimmed sequence of events:

First the device appears and NM starts doing stuff with it, including bringing
the interface up:

Nov 09 16:38:37 xo-93-20-8d.localdomain kernel: asix 1-1.2:1.0: eth0: register
'asix' at usb-d4208000.usb-1.2, ASIX AX88772 USB 2.0 Ethernet,
00:1c:49:01:05:e9
Nov 09 16:38:38 xo-93-20-8d.localdomain NetworkManager[371]: <info> (eth0):
carrier is OFF
Nov 09 16:38:38 xo-93-20-8d.localdomain NetworkManager[371]: <error>
[1352479118.338790] [nm-device-ethernet.c:454] update_permanent_hw_address():
(eth0): unable to read permanent MAC address (error 0)
Nov 09 16:38:38 xo-93-20-8d.localdomain NetworkManager[371]: <info> (eth0): new
Ethernet device (driver: 'asix' ifindex: 2)
Nov 09 16:38:39 xo-93-20-8d.localdomain kernel: IPv6: ADDRCONF(NETDEV_UP):
eth0: link is not ready
Nov 09 16:38:39 xo-93-20-8d.localdomain NetworkManager[371]: <info> (eth0):
preparing device.

Then my udev rule PROGRAM gets run which outputs these lines to /dev/kmsg:

Nov 09 16:38:39 xo-93-20-8d.localdomain : eth namer
Nov 09 16:38:39 xo-93-20-8d.localdomain : eth namer eth1

Its trying to rename the new device to eth1. But that then fails, because the
network interface is up.

Nov 09 16:38:40 xo-93-20-8d.localdomain systemd-udevd[258]: error changing net
interface name eth0 to eth1: Device or resource busy


I checked the NM code, it uses libgudev to become aware of new network devices,
and ones that are available at startup. So this seems like a udev bug - it
should not be advertising these devices to libgudev clients before udev itself
has finished applying the rule-driven configuration.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>