chiark / gitweb /
udev: remove HWDB_BIN
[elogind.git] / src / udev / udev-builtin-net_id.c
index 312a54a6c1368e91954bdec6c3cabf1800897a42..7ffdaad73fa2389225ce997ca1db276b0758444e 100644 (file)
@@ -24,6 +24,8 @@
  *  - physical/geographical location of the hardware
  *  - the interface's MAC address
  *
+ * http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
+ *
  * Two character prefixes based on the type of interface:
  *   en -- ethernet
  *   wl -- wlan
@@ -327,10 +329,13 @@ static int names_bcma(struct udev_device *dev, struct netnames *names) {
         if (!bcmadev)
                 return -ENOENT;
 
-        /* bus numcore num */
+        /* bus num:core num */
         if (sscanf(udev_device_get_sysname(bcmadev), "bcma%*d:%d", &core) != 1)
                 return -EINVAL;
-        snprintf(names->bcma_core, sizeof(names->bcma_core), "b%d", core);
+        /* suppress the common core == 0 */
+        if (core > 0)
+                snprintf(names->bcma_core, sizeof(names->bcma_core), "b%d", core);
+
         names->type = NET_BCMA;
         return 0;
 }