2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2012-11-09 12:37:40 +01:00
|
|
|
|
2012-11-20 18:10:45 +01:00
|
|
|
/*
|
2012-12-06 21:25:39 +01:00
|
|
|
* Predictable network interface device names based on:
|
2012-12-02 02:00:57 +01:00
|
|
|
* - firmware/bios-provided index numbers for on-board devices
|
|
|
|
* - firmware-provided pci-express hotplug slot index number
|
|
|
|
* - physical/geographical location of the hardware
|
|
|
|
* - the interface's MAC address
|
|
|
|
*
|
2013-01-19 16:01:26 +01:00
|
|
|
* http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames
|
|
|
|
*
|
2012-12-06 21:25:39 +01:00
|
|
|
* Two character prefixes based on the type of interface:
|
2016-04-22 04:57:06 +02:00
|
|
|
* en — Ethernet
|
|
|
|
* sl — serial line IP (slip)
|
|
|
|
* wl — wlan
|
|
|
|
* ww — wwan
|
2012-11-20 18:10:45 +01:00
|
|
|
*
|
2012-12-06 21:25:39 +01:00
|
|
|
* Type of names:
|
2016-04-22 04:57:06 +02:00
|
|
|
* b<number> — BCMA bus core number
|
2017-02-17 16:18:01 +01:00
|
|
|
* c<bus_id> — bus id of a grouped CCW or CCW device,
|
|
|
|
* with all leading zeros stripped [s390]
|
2016-11-02 03:46:01 +01:00
|
|
|
* o<index>[n<phys_port_name>|d<dev_port>]
|
|
|
|
* — on-board device index number
|
|
|
|
* s<slot>[f<function>][n<phys_port_name>|d<dev_port>]
|
|
|
|
* — hotplug slot index number
|
2016-04-22 04:57:06 +02:00
|
|
|
* x<MAC> — MAC address
|
2016-11-02 03:46:01 +01:00
|
|
|
* [P<domain>]p<bus>s<slot>[f<function>][n<phys_port_name>|d<dev_port>]
|
2016-04-22 04:57:06 +02:00
|
|
|
* — PCI geographical location
|
2013-06-12 15:32:47 +02:00
|
|
|
* [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>]
|
2016-04-22 04:57:06 +02:00
|
|
|
* — USB port number chain
|
2017-03-31 16:32:09 +02:00
|
|
|
* v<slot> - VIO slot number (IBM PowerVM)
|
2017-05-17 15:28:35 +02:00
|
|
|
* a<vendor><model>i<instance> — Platform bus ACPI instance id
|
2012-12-02 02:00:57 +01:00
|
|
|
*
|
2012-12-06 21:25:39 +01:00
|
|
|
* All multi-function PCI devices will carry the [f<function>] number in the
|
2012-12-02 02:00:57 +01:00
|
|
|
* device name, including the function 0 device.
|
2012-11-20 18:10:45 +01:00
|
|
|
*
|
2018-07-30 13:56:07 +02:00
|
|
|
* SR-IOV virtual devices are named based on the name of the parent interface,
|
|
|
|
* with a suffix of "v<N>", where <N> is the virtual device number.
|
|
|
|
*
|
2013-06-12 15:32:47 +02:00
|
|
|
* When using PCI geography, The PCI domain is only prepended when it is not 0.
|
|
|
|
*
|
2012-12-06 21:27:42 +01:00
|
|
|
* For USB devices the full chain of port numbers of hubs is composed. If the
|
|
|
|
* name gets longer than the maximum number of 15 characters, the name is not
|
|
|
|
* exported.
|
|
|
|
* The usual USB configuration == 1 and interface == 0 values are suppressed.
|
2012-12-06 21:25:39 +01:00
|
|
|
*
|
2014-08-03 07:11:37 +02:00
|
|
|
* PCI Ethernet card with firmware index "1":
|
2012-11-26 14:07:16 +01:00
|
|
|
* ID_NET_NAME_ONBOARD=eno1
|
2012-12-06 21:09:30 +01:00
|
|
|
* ID_NET_NAME_ONBOARD_LABEL=Ethernet Port 1
|
|
|
|
*
|
2014-08-03 07:11:37 +02:00
|
|
|
* PCI Ethernet card in hotplug slot with firmware index number:
|
2012-12-06 21:09:30 +01:00
|
|
|
* /sys/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/net/ens1
|
|
|
|
* ID_NET_NAME_MAC=enx000000000466
|
|
|
|
* ID_NET_NAME_PATH=enp5s0
|
2012-11-30 19:27:42 +01:00
|
|
|
* ID_NET_NAME_SLOT=ens1
|
2012-12-06 21:09:30 +01:00
|
|
|
*
|
2014-08-03 07:11:37 +02:00
|
|
|
* PCI Ethernet multi-function card with 2 ports:
|
2012-12-09 14:49:28 +01:00
|
|
|
* /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/net/enp2s0f0
|
|
|
|
* ID_NET_NAME_MAC=enx78e7d1ea46da
|
|
|
|
* ID_NET_NAME_PATH=enp2s0f0
|
|
|
|
* /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.1/net/enp2s0f1
|
|
|
|
* ID_NET_NAME_MAC=enx78e7d1ea46dc
|
|
|
|
* ID_NET_NAME_PATH=enp2s0f1
|
|
|
|
*
|
2012-12-06 21:09:30 +01:00
|
|
|
* PCI wlan card:
|
|
|
|
* /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlp3s0
|
|
|
|
* ID_NET_NAME_MAC=wlx0024d7e31130
|
|
|
|
* ID_NET_NAME_PATH=wlp3s0
|
|
|
|
*
|
|
|
|
* USB built-in 3G modem:
|
|
|
|
* /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.6/net/wwp0s29u1u4i6
|
|
|
|
* ID_NET_NAME_MAC=wwx028037ec0200
|
|
|
|
* ID_NET_NAME_PATH=wwp0s29u1u4i6
|
|
|
|
*
|
|
|
|
* USB Android phone:
|
|
|
|
* /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/enp0s29u1u2
|
|
|
|
* ID_NET_NAME_MAC=enxd626b3450fb5
|
|
|
|
* ID_NET_NAME_PATH=enp0s29u1u2
|
2017-02-17 16:18:01 +01:00
|
|
|
*
|
|
|
|
* s390 grouped CCW interface:
|
|
|
|
* /sys/devices/css0/0.0.0007/0.0.f5f0/group_device/net/encf5f0
|
|
|
|
* ID_NET_NAME_MAC=enx026d3c00000a
|
|
|
|
* ID_NET_NAME_PATH=encf5f0
|
2012-11-20 18:10:45 +01:00
|
|
|
*/
|
|
|
|
|
2012-11-09 12:37:40 +01:00
|
|
|
#include <errno.h>
|
2015-10-24 22:58:24 +02:00
|
|
|
#include <fcntl.h>
|
2012-12-06 20:42:49 +01:00
|
|
|
#include <net/if.h>
|
2014-04-06 18:00:26 +02:00
|
|
|
#include <net/if_arp.h>
|
2015-10-24 22:58:24 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2012-11-30 19:27:42 +01:00
|
|
|
#include <linux/pci_regs.h>
|
2012-11-09 12:37:40 +01:00
|
|
|
|
2016-12-09 10:04:30 +01:00
|
|
|
#include "dirent-util.h"
|
2015-10-25 13:14:12 +01:00
|
|
|
#include "fd-util.h"
|
2013-02-14 12:26:13 +01:00
|
|
|
#include "fileio.h"
|
2018-01-17 20:31:55 +01:00
|
|
|
#include "fs-util.h"
|
2018-01-16 22:08:10 +01:00
|
|
|
#include "parse-util.h"
|
2016-01-12 15:34:20 +01:00
|
|
|
#include "stdio-util.h"
|
2015-10-24 22:58:24 +02:00
|
|
|
#include "string-util.h"
|
|
|
|
#include "udev.h"
|
2012-11-09 12:37:40 +01:00
|
|
|
|
2016-01-25 17:16:27 +01:00
|
|
|
#define ONBOARD_INDEX_MAX (16*1024-1)
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
enum netname_type{
|
|
|
|
NET_UNDEF,
|
|
|
|
NET_PCI,
|
|
|
|
NET_USB,
|
2013-01-17 02:09:49 +01:00
|
|
|
NET_BCMA,
|
2014-01-04 14:43:45 +01:00
|
|
|
NET_VIRTIO,
|
2017-02-17 16:18:01 +01:00
|
|
|
NET_CCW,
|
2017-03-31 16:32:09 +02:00
|
|
|
NET_VIO,
|
2017-05-17 15:28:35 +02:00
|
|
|
NET_PLATFORM,
|
2012-12-06 20:42:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct netnames {
|
|
|
|
enum netname_type type;
|
|
|
|
|
|
|
|
uint8_t mac[6];
|
|
|
|
bool mac_valid;
|
|
|
|
|
|
|
|
struct udev_device *pcidev;
|
|
|
|
char pci_slot[IFNAMSIZ];
|
|
|
|
char pci_path[IFNAMSIZ];
|
|
|
|
char pci_onboard[IFNAMSIZ];
|
|
|
|
const char *pci_onboard_label;
|
|
|
|
|
|
|
|
char usb_ports[IFNAMSIZ];
|
2013-01-17 02:09:49 +01:00
|
|
|
char bcma_core[IFNAMSIZ];
|
2017-02-17 16:18:01 +01:00
|
|
|
char ccw_busid[IFNAMSIZ];
|
2017-03-31 16:32:09 +02:00
|
|
|
char vio_slot[IFNAMSIZ];
|
2017-05-17 15:28:35 +02:00
|
|
|
char platform_path[IFNAMSIZ];
|
2012-12-06 20:42:49 +01:00
|
|
|
};
|
|
|
|
|
2018-01-17 20:31:55 +01:00
|
|
|
struct virtfn_info {
|
|
|
|
struct udev_device *physfn_pcidev;
|
|
|
|
char suffix[IFNAMSIZ];
|
|
|
|
};
|
|
|
|
|
2017-02-17 16:18:01 +01:00
|
|
|
/* skip intermediate virtio devices */
|
|
|
|
static struct udev_device *skip_virtio(struct udev_device *dev) {
|
|
|
|
struct udev_device *parent = dev;
|
|
|
|
|
|
|
|
/* there can only ever be one virtio bus per parent device, so we can
|
|
|
|
safely ignore any virtio buses. see
|
|
|
|
<http://lists.linuxfoundation.org/pipermail/virtualization/2015-August/030331.html> */
|
|
|
|
while (parent && streq_ptr("virtio", udev_device_get_subsystem(parent)))
|
|
|
|
parent = udev_device_get_parent(parent);
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
|
2018-01-17 20:31:55 +01:00
|
|
|
static int get_virtfn_info(struct udev_device *dev, struct netnames *names, struct virtfn_info *vf_info) {
|
|
|
|
struct udev *udev;
|
|
|
|
const char *physfn_link_file;
|
|
|
|
_cleanup_free_ char *physfn_pci_syspath = NULL;
|
|
|
|
_cleanup_free_ char *virtfn_pci_syspath = NULL;
|
|
|
|
struct dirent *dent;
|
|
|
|
_cleanup_closedir_ DIR *dir = NULL;
|
|
|
|
struct virtfn_info vf_info_local = {};
|
|
|
|
int r;
|
|
|
|
|
|
|
|
udev = udev_device_get_udev(names->pcidev);
|
|
|
|
if (!udev)
|
|
|
|
return -ENOENT;
|
|
|
|
/* Check if this is a virtual function. */
|
|
|
|
physfn_link_file = strjoina(udev_device_get_syspath(names->pcidev), "/physfn");
|
|
|
|
r = chase_symlinks(physfn_link_file, NULL, 0, &physfn_pci_syspath);
|
|
|
|
if (r < 0)
|
|
|
|
return r;
|
|
|
|
|
|
|
|
/* Get physical function's pci device. */
|
|
|
|
vf_info_local.physfn_pcidev = udev_device_new_from_syspath(udev, physfn_pci_syspath);
|
|
|
|
if (!vf_info_local.physfn_pcidev)
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
/* Find the virtual function number by finding the right virtfn link. */
|
|
|
|
dir = opendir(physfn_pci_syspath);
|
|
|
|
if (!dir) {
|
|
|
|
r = -errno;
|
|
|
|
goto out_unref;
|
|
|
|
}
|
|
|
|
FOREACH_DIRENT_ALL(dent, dir, break) {
|
|
|
|
_cleanup_free_ char *virtfn_link_file = NULL;
|
|
|
|
if (!startswith(dent->d_name, "virtfn"))
|
|
|
|
continue;
|
|
|
|
virtfn_link_file = strjoin(physfn_pci_syspath, "/", dent->d_name);
|
|
|
|
if (!virtfn_link_file) {
|
|
|
|
r = -ENOMEM;
|
|
|
|
goto out_unref;
|
|
|
|
}
|
|
|
|
if (chase_symlinks(virtfn_link_file, NULL, 0, &virtfn_pci_syspath) < 0)
|
|
|
|
continue;
|
|
|
|
if (streq(udev_device_get_syspath(names->pcidev), virtfn_pci_syspath)) {
|
|
|
|
if (!snprintf_ok(vf_info_local.suffix, sizeof(vf_info_local.suffix), "v%s", &dent->d_name[6])) {
|
|
|
|
r = -ENOENT;
|
|
|
|
goto out_unref;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isempty(vf_info_local.suffix)) {
|
|
|
|
r = -ENOENT;
|
|
|
|
goto out_unref;
|
|
|
|
}
|
|
|
|
*vf_info = vf_info_local;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
out_unref:
|
|
|
|
udev_device_unref(vf_info_local.physfn_pcidev);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2012-11-26 14:07:16 +01:00
|
|
|
/* retrieve on-board index number and label from firmware */
|
2012-12-06 20:42:49 +01:00
|
|
|
static int dev_pci_onboard(struct udev_device *dev, struct netnames *names) {
|
2015-04-01 16:51:02 +02:00
|
|
|
unsigned dev_port = 0;
|
|
|
|
size_t l;
|
|
|
|
char *s;
|
2016-11-02 03:46:01 +01:00
|
|
|
const char *attr, *port_name;
|
2012-11-26 14:07:16 +01:00
|
|
|
int idx;
|
2012-11-09 12:37:40 +01:00
|
|
|
|
2016-04-22 04:57:06 +02:00
|
|
|
/* ACPI _DSM — device specific method for naming a PCI or PCI Express device */
|
2015-04-01 16:51:02 +02:00
|
|
|
attr = udev_device_get_sysattr_value(names->pcidev, "acpi_index");
|
2016-04-22 04:57:06 +02:00
|
|
|
/* SMBIOS type 41 — Onboard Devices Extended Information */
|
2015-04-01 16:51:02 +02:00
|
|
|
if (!attr)
|
|
|
|
attr = udev_device_get_sysattr_value(names->pcidev, "index");
|
|
|
|
if (!attr)
|
2012-11-26 14:07:16 +01:00
|
|
|
return -ENOENT;
|
2015-04-01 16:51:02 +02:00
|
|
|
|
|
|
|
idx = strtoul(attr, NULL, 0);
|
2012-11-26 14:07:16 +01:00
|
|
|
if (idx <= 0)
|
|
|
|
return -EINVAL;
|
2015-04-01 16:51:02 +02:00
|
|
|
|
2016-01-25 17:16:27 +01:00
|
|
|
/* Some BIOSes report rubbish indexes that are excessively high (2^24-1 is an index VMware likes to report for
|
|
|
|
* example). Let's define a cut-off where we don't consider the index reliable anymore. We pick some arbitrary
|
|
|
|
* cut-off, which is somewhere beyond the realistic number of physical network interface a system might
|
|
|
|
* have. Ideally the kernel would already filter his crap for us, but it doesn't currently. */
|
|
|
|
if (idx > ONBOARD_INDEX_MAX)
|
|
|
|
return -ENOENT;
|
|
|
|
|
2015-04-01 23:34:19 +02:00
|
|
|
/* kernel provided port index for multiple ports on a single PCI function */
|
2015-04-01 16:51:02 +02:00
|
|
|
attr = udev_device_get_sysattr_value(dev, "dev_port");
|
|
|
|
if (attr)
|
|
|
|
dev_port = strtol(attr, NULL, 10);
|
|
|
|
|
2016-11-02 03:46:01 +01:00
|
|
|
/* kernel provided front panel port name for multiple port PCI device */
|
|
|
|
port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
|
|
|
|
|
2015-04-01 16:51:02 +02:00
|
|
|
s = names->pci_onboard;
|
|
|
|
l = sizeof(names->pci_onboard);
|
|
|
|
l = strpcpyf(&s, l, "o%d", idx);
|
2016-11-02 03:46:01 +01:00
|
|
|
if (port_name)
|
|
|
|
l = strpcpyf(&s, l, "n%s", port_name);
|
|
|
|
else if (dev_port > 0)
|
2015-04-01 16:51:02 +02:00
|
|
|
l = strpcpyf(&s, l, "d%d", dev_port);
|
|
|
|
if (l == 0)
|
|
|
|
names->pci_onboard[0] = '\0';
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
names->pci_onboard_label = udev_device_get_sysattr_value(names->pcidev, "label");
|
2015-04-01 16:51:02 +02:00
|
|
|
|
2012-11-26 14:07:16 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2012-12-03 15:47:18 +01:00
|
|
|
/* read the 256 bytes PCI configuration space to check the multi-function bit */
|
2013-01-04 19:08:08 +01:00
|
|
|
static bool is_pci_multifunction(struct udev_device *dev) {
|
2015-05-22 20:30:01 +02:00
|
|
|
_cleanup_close_ int fd = -1;
|
2014-08-12 01:43:23 +02:00
|
|
|
const char *filename;
|
|
|
|
uint8_t config[64];
|
2012-11-30 19:27:42 +01:00
|
|
|
|
2015-02-03 02:05:59 +01:00
|
|
|
filename = strjoina(udev_device_get_syspath(dev), "/config");
|
2015-05-22 20:30:01 +02:00
|
|
|
fd = open(filename, O_RDONLY | O_CLOEXEC);
|
|
|
|
if (fd < 0)
|
2014-08-12 01:43:23 +02:00
|
|
|
return false;
|
2015-05-22 20:30:01 +02:00
|
|
|
if (read(fd, &config, sizeof(config)) != sizeof(config))
|
2014-08-12 01:43:23 +02:00
|
|
|
return false;
|
2012-11-30 19:27:42 +01:00
|
|
|
|
|
|
|
/* bit 0-6 header type, bit 7 multi/single function device */
|
2013-01-04 19:08:08 +01:00
|
|
|
if ((config[PCI_HEADER_TYPE] & 0x80) != 0)
|
2014-08-12 01:43:23 +02:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
2012-11-30 19:27:42 +01:00
|
|
|
}
|
|
|
|
|
2018-01-18 21:14:56 +01:00
|
|
|
static bool is_pci_ari_enabled(struct udev_device *dev) {
|
2018-05-02 16:21:30 +02:00
|
|
|
return streq_ptr(udev_device_get_sysattr_value(dev, "ari_enabled"), "1");
|
2018-01-18 21:14:56 +01:00
|
|
|
}
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
|
|
|
|
struct udev *udev = udev_device_get_udev(names->pcidev);
|
2018-01-16 22:08:10 +01:00
|
|
|
unsigned domain, bus, slot, func, dev_port = 0, hotplug_slot = 0;
|
2013-01-04 19:08:08 +01:00
|
|
|
size_t l;
|
|
|
|
char *s;
|
2016-11-02 03:46:01 +01:00
|
|
|
const char *attr, *port_name;
|
tree-wide: drop redundant _cleanup_ macros (#8810)
This drops a good number of type-specific _cleanup_ macros, and patches
all users to just use the generic ones.
In most recent code we abstained from defining type-specific macros, and
this basically removes all those added already, with the exception of
the really low-level ones.
Having explicit macros for this is not too useful, as the expression
without the extra macro is generally just 2ch wider. We should generally
emphesize generic code, unless there are really good reasons for
specific code, hence let's follow this in this case too.
Note that _cleanup_free_ and similar really low-level, libc'ish, Linux
API'ish macros continue to be defined, only the really high-level OO
ones are dropped. From now on this should really be the rule: for really
low-level stuff, such as memory allocation, fd handling and so one, go
ahead and define explicit per-type macros, but for high-level, specific
program code, just use the generic _cleanup_() macro directly, in order
to keep things simple and as readable as possible for the uninitiated.
Note that before this patch some of the APIs (notable libudev ones) were
already used with the high-level macros at some places and with the
generic _cleanup_ macro at others. With this patch we hence unify on the
latter.
2018-04-25 12:31:45 +02:00
|
|
|
_cleanup_(udev_device_unrefp) struct udev_device *pci = NULL;
|
2018-01-16 22:08:10 +01:00
|
|
|
struct udev_device *hotplug_slot_dev;
|
2016-11-03 03:02:46 +01:00
|
|
|
char slots[PATH_MAX];
|
2013-12-15 22:26:27 +01:00
|
|
|
_cleanup_closedir_ DIR *dir = NULL;
|
2012-11-26 14:07:16 +01:00
|
|
|
struct dirent *dent;
|
|
|
|
|
2013-12-15 22:26:27 +01:00
|
|
|
if (sscanf(udev_device_get_sysname(names->pcidev), "%x:%x:%x.%u", &domain, &bus, &slot, &func) != 4)
|
2012-11-26 14:07:16 +01:00
|
|
|
return -ENOENT;
|
2018-01-18 21:14:56 +01:00
|
|
|
if (is_pci_ari_enabled(names->pcidev))
|
|
|
|
/* ARI devices support up to 256 functions on a single device ("slot"), and interpret the
|
|
|
|
* traditional 5-bit slot and 3-bit function number as a single 8-bit function number,
|
|
|
|
* where the slot makes up the upper 5 bits. */
|
|
|
|
func += slot * 8;
|
2013-01-04 19:08:08 +01:00
|
|
|
|
2015-04-01 23:34:19 +02:00
|
|
|
/* kernel provided port index for multiple ports on a single PCI function */
|
2014-07-01 15:11:50 +02:00
|
|
|
attr = udev_device_get_sysattr_value(dev, "dev_port");
|
2013-01-04 19:08:08 +01:00
|
|
|
if (attr)
|
2014-07-01 15:11:50 +02:00
|
|
|
dev_port = strtol(attr, NULL, 10);
|
2013-01-04 19:08:08 +01:00
|
|
|
|
2016-11-02 03:46:01 +01:00
|
|
|
/* kernel provided front panel port name for multiple port PCI device */
|
|
|
|
port_name = udev_device_get_sysattr_value(dev, "phys_port_name");
|
|
|
|
|
2013-01-04 19:08:08 +01:00
|
|
|
/* compose a name based on the raw kernel's PCI bus, slot numbers */
|
|
|
|
s = names->pci_path;
|
2013-06-12 15:32:47 +02:00
|
|
|
l = sizeof(names->pci_path);
|
|
|
|
if (domain > 0)
|
2015-01-21 04:22:15 +01:00
|
|
|
l = strpcpyf(&s, l, "P%u", domain);
|
|
|
|
l = strpcpyf(&s, l, "p%us%u", bus, slot);
|
2013-01-04 19:08:08 +01:00
|
|
|
if (func > 0 || is_pci_multifunction(names->pcidev))
|
2015-01-21 04:22:15 +01:00
|
|
|
l = strpcpyf(&s, l, "f%u", func);
|
2016-11-02 03:46:01 +01:00
|
|
|
if (port_name)
|
|
|
|
l = strpcpyf(&s, l, "n%s", port_name);
|
|
|
|
else if (dev_port > 0)
|
2015-01-21 04:22:15 +01:00
|
|
|
l = strpcpyf(&s, l, "d%u", dev_port);
|
2013-01-04 19:08:08 +01:00
|
|
|
if (l == 0)
|
|
|
|
names->pci_path[0] = '\0';
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2016-04-22 04:57:06 +02:00
|
|
|
/* ACPI _SUN — slot user number */
|
2012-11-26 14:07:16 +01:00
|
|
|
pci = udev_device_new_from_subsystem_sysname(udev, "subsystem", "pci");
|
2018-02-23 11:09:13 +01:00
|
|
|
if (!pci)
|
|
|
|
return -ENOENT;
|
2016-11-03 03:02:46 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (!snprintf_ok(slots, sizeof slots, "%s/slots", udev_device_get_syspath(pci)))
|
|
|
|
return -ENAMETOOLONG;
|
|
|
|
|
2012-11-26 14:07:16 +01:00
|
|
|
dir = opendir(slots);
|
2018-02-23 11:09:13 +01:00
|
|
|
if (!dir)
|
|
|
|
return -errno;
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2018-01-16 22:08:10 +01:00
|
|
|
hotplug_slot_dev = names->pcidev;
|
|
|
|
while (hotplug_slot_dev) {
|
|
|
|
FOREACH_DIRENT_ALL(dent, dir, break) {
|
|
|
|
unsigned i;
|
|
|
|
int r;
|
|
|
|
char str[PATH_MAX];
|
|
|
|
_cleanup_free_ char *address = NULL;
|
|
|
|
|
|
|
|
if (dent->d_name[0] == '.')
|
|
|
|
continue;
|
|
|
|
r = safe_atou_full(dent->d_name, 10, &i);
|
|
|
|
if (i < 1 || r < 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (snprintf_ok(str, sizeof str, "%s/%s/address", slots, dent->d_name) &&
|
|
|
|
read_one_line_file(str, &address) >= 0)
|
|
|
|
/* match slot address with device by stripping the function */
|
|
|
|
if (startswith(udev_device_get_sysname(hotplug_slot_dev), address))
|
|
|
|
hotplug_slot = i;
|
|
|
|
|
|
|
|
if (hotplug_slot > 0)
|
|
|
|
break;
|
|
|
|
}
|
2012-11-26 14:07:16 +01:00
|
|
|
if (hotplug_slot > 0)
|
|
|
|
break;
|
2018-01-16 22:08:10 +01:00
|
|
|
rewinddir(dir);
|
|
|
|
hotplug_slot_dev = udev_device_get_parent_with_subsystem_devtype(hotplug_slot_dev, "pci", NULL);
|
2012-11-26 14:07:16 +01:00
|
|
|
}
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2012-11-26 14:07:16 +01:00
|
|
|
if (hotplug_slot > 0) {
|
2013-01-04 19:08:08 +01:00
|
|
|
s = names->pci_slot;
|
2013-06-12 15:32:47 +02:00
|
|
|
l = sizeof(names->pci_slot);
|
|
|
|
if (domain > 0)
|
|
|
|
l = strpcpyf(&s, l, "P%d", domain);
|
|
|
|
l = strpcpyf(&s, l, "s%d", hotplug_slot);
|
2013-01-04 19:08:08 +01:00
|
|
|
if (func > 0 || is_pci_multifunction(names->pcidev))
|
2013-01-09 19:06:46 +01:00
|
|
|
l = strpcpyf(&s, l, "f%d", func);
|
2016-11-02 03:46:01 +01:00
|
|
|
if (port_name)
|
|
|
|
l = strpcpyf(&s, l, "n%s", port_name);
|
|
|
|
else if (dev_port > 0)
|
2014-07-01 15:11:50 +02:00
|
|
|
l = strpcpyf(&s, l, "d%d", dev_port);
|
2013-01-04 19:08:08 +01:00
|
|
|
if (l == 0)
|
2015-04-01 16:41:41 +02:00
|
|
|
names->pci_slot[0] = '\0';
|
2012-11-20 18:10:45 +01:00
|
|
|
}
|
2018-02-23 11:09:13 +01:00
|
|
|
|
|
|
|
return 0;
|
2012-11-26 14:07:16 +01:00
|
|
|
}
|
|
|
|
|
2017-03-31 16:32:09 +02:00
|
|
|
static int names_vio(struct udev_device *dev, struct netnames *names) {
|
|
|
|
struct udev_device *parent;
|
|
|
|
unsigned busid, slotid, ethid;
|
|
|
|
const char *syspath;
|
|
|
|
|
|
|
|
/* check if our direct parent is a VIO device with no other bus in-between */
|
|
|
|
parent = udev_device_get_parent(dev);
|
|
|
|
if (!parent)
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
if (!streq_ptr("vio", udev_device_get_subsystem(parent)))
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
/* The devices' $DEVPATH number is tied to (virtual) hardware (slot id
|
|
|
|
* selected in the HMC), thus this provides a reliable naming (e.g.
|
|
|
|
* "/devices/vio/30000002/net/eth1"); we ignore the bus number, as
|
|
|
|
* there should only ever be one bus, and then remove leading zeros. */
|
|
|
|
syspath = udev_device_get_syspath(dev);
|
|
|
|
|
|
|
|
if (sscanf(syspath, "/sys/devices/vio/%4x%4x/net/eth%u", &busid, &slotid, ðid) != 3)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
xsprintf(names->vio_slot, "v%u", slotid);
|
|
|
|
names->type = NET_VIO;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-05-17 15:28:35 +02:00
|
|
|
#define _PLATFORM_TEST "/sys/devices/platform/vvvvPPPP"
|
|
|
|
#define _PLATFORM_PATTERN4 "/sys/devices/platform/%4s%4x:%2x/net/eth%u"
|
|
|
|
#define _PLATFORM_PATTERN3 "/sys/devices/platform/%3s%4x:%2x/net/eth%u"
|
|
|
|
|
|
|
|
static int names_platform(struct udev_device *dev, struct netnames *names, bool test) {
|
|
|
|
struct udev_device *parent;
|
|
|
|
char vendor[5];
|
|
|
|
unsigned model, instance, ethid;
|
|
|
|
const char *syspath, *pattern, *validchars;
|
|
|
|
|
|
|
|
/* check if our direct parent is a platform device with no other bus in-between */
|
|
|
|
parent = udev_device_get_parent(dev);
|
|
|
|
if (!parent)
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
if (!streq_ptr("platform", udev_device_get_subsystem(parent)))
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
syspath = udev_device_get_syspath(dev);
|
|
|
|
|
|
|
|
/* syspath is too short, to have a valid ACPI instance */
|
|
|
|
if (strlen(syspath) < sizeof _PLATFORM_TEST)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/* Vendor ID can be either PNP ID (3 chars A-Z) or ACPI ID (4 chars A-Z and numerals) */
|
|
|
|
if (syspath[sizeof _PLATFORM_TEST - 1] == ':') {
|
|
|
|
pattern = _PLATFORM_PATTERN4;
|
|
|
|
validchars = UPPERCASE_LETTERS DIGITS;
|
|
|
|
} else {
|
|
|
|
pattern = _PLATFORM_PATTERN3;
|
|
|
|
validchars = UPPERCASE_LETTERS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Platform devices are named after ACPI table match, and instance id
|
|
|
|
* eg. "/sys/devices/platform/HISI00C2:00");
|
|
|
|
* The Vendor (3 or 4 char), followed by hexdecimal model number : instance id.
|
|
|
|
*/
|
2017-05-18 18:25:02 +02:00
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
2017-05-17 15:28:35 +02:00
|
|
|
if (sscanf(syspath, pattern, vendor, &model, &instance, ðid) != 4)
|
|
|
|
return -EINVAL;
|
2017-05-18 18:25:02 +02:00
|
|
|
#pragma GCC diagnostic pop
|
2017-05-17 15:28:35 +02:00
|
|
|
|
|
|
|
if (!in_charset(vendor, validchars))
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
ascii_strlower(vendor);
|
|
|
|
|
|
|
|
xsprintf(names->platform_path, "a%s%xi%u", vendor, model, instance);
|
|
|
|
names->type = NET_PLATFORM;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
static int names_pci(struct udev_device *dev, struct netnames *names) {
|
2012-11-26 15:03:06 +01:00
|
|
|
struct udev_device *parent;
|
2018-01-17 20:31:55 +01:00
|
|
|
struct netnames vf_names = {};
|
|
|
|
struct virtfn_info vf_info = {};
|
2012-11-26 14:07:16 +01:00
|
|
|
|
2015-06-02 16:52:07 +02:00
|
|
|
assert(dev);
|
|
|
|
assert(names);
|
|
|
|
|
2012-11-26 15:03:06 +01:00
|
|
|
parent = udev_device_get_parent(dev);
|
2017-02-17 16:18:01 +01:00
|
|
|
/* skip virtio subsystem if present */
|
|
|
|
parent = skip_virtio(parent);
|
2015-08-25 14:12:19 +02:00
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
if (!parent)
|
|
|
|
return -ENOENT;
|
2015-08-25 14:12:19 +02:00
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
/* check if our direct parent is a PCI device with no other bus in-between */
|
2013-03-03 18:55:08 +01:00
|
|
|
if (streq_ptr("pci", udev_device_get_subsystem(parent))) {
|
2012-12-06 20:42:49 +01:00
|
|
|
names->type = NET_PCI;
|
|
|
|
names->pcidev = parent;
|
|
|
|
} else {
|
|
|
|
names->pcidev = udev_device_get_parent_with_subsystem_devtype(dev, "pci", NULL);
|
|
|
|
if (!names->pcidev)
|
|
|
|
return -ENOENT;
|
|
|
|
}
|
2018-01-17 20:31:55 +01:00
|
|
|
|
|
|
|
if (get_virtfn_info(dev, names, &vf_info) >= 0) {
|
|
|
|
/* If this is an SR-IOV virtual device, get base name using physical device and add virtfn suffix. */
|
|
|
|
vf_names.pcidev = vf_info.physfn_pcidev;
|
|
|
|
dev_pci_onboard(dev, &vf_names);
|
|
|
|
dev_pci_slot(dev, &vf_names);
|
|
|
|
if (vf_names.pci_onboard[0])
|
|
|
|
if (strlen(vf_names.pci_onboard) + strlen(vf_info.suffix) < sizeof(names->pci_onboard))
|
|
|
|
strscpyl(names->pci_onboard, sizeof(names->pci_onboard),
|
|
|
|
vf_names.pci_onboard, vf_info.suffix, NULL);
|
|
|
|
if (vf_names.pci_slot[0])
|
|
|
|
if (strlen(vf_names.pci_slot) + strlen(vf_info.suffix) < sizeof(names->pci_slot))
|
|
|
|
strscpyl(names->pci_slot, sizeof(names->pci_slot),
|
|
|
|
vf_names.pci_slot, vf_info.suffix, NULL);
|
|
|
|
if (vf_names.pci_path[0])
|
|
|
|
if (strlen(vf_names.pci_path) + strlen(vf_info.suffix) < sizeof(names->pci_path))
|
|
|
|
strscpyl(names->pci_path, sizeof(names->pci_path),
|
|
|
|
vf_names.pci_path, vf_info.suffix, NULL);
|
|
|
|
udev_device_unref(vf_info.physfn_pcidev);
|
|
|
|
} else {
|
|
|
|
dev_pci_onboard(dev, names);
|
|
|
|
dev_pci_slot(dev, names);
|
|
|
|
}
|
2012-12-06 20:42:49 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int names_usb(struct udev_device *dev, struct netnames *names) {
|
2013-01-17 02:09:49 +01:00
|
|
|
struct udev_device *usbdev;
|
2012-12-06 20:42:49 +01:00
|
|
|
char name[256];
|
|
|
|
char *ports;
|
|
|
|
char *config;
|
|
|
|
char *interf;
|
|
|
|
size_t l;
|
|
|
|
char *s;
|
|
|
|
|
2015-06-02 16:52:07 +02:00
|
|
|
assert(dev);
|
|
|
|
assert(names);
|
|
|
|
|
2013-01-17 02:09:49 +01:00
|
|
|
usbdev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_interface");
|
|
|
|
if (!usbdev)
|
2012-11-26 14:07:16 +01:00
|
|
|
return -ENOENT;
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
/* get USB port number chain, configuration, interface */
|
2013-01-17 02:09:49 +01:00
|
|
|
strscpy(name, sizeof(name), udev_device_get_sysname(usbdev));
|
2012-12-06 20:42:49 +01:00
|
|
|
s = strchr(name, '-');
|
|
|
|
if (!s)
|
|
|
|
return -EINVAL;
|
|
|
|
ports = s+1;
|
|
|
|
|
|
|
|
s = strchr(ports, ':');
|
|
|
|
if (!s)
|
|
|
|
return -EINVAL;
|
|
|
|
s[0] = '\0';
|
|
|
|
config = s+1;
|
|
|
|
|
|
|
|
s = strchr(config, '.');
|
|
|
|
if (!s)
|
|
|
|
return -EINVAL;
|
|
|
|
s[0] = '\0';
|
|
|
|
interf = s+1;
|
|
|
|
|
2014-12-10 20:00:09 +01:00
|
|
|
/* prefix every port number in the chain with "u" */
|
2012-12-06 20:42:49 +01:00
|
|
|
s = ports;
|
|
|
|
while ((s = strchr(s, '.')))
|
|
|
|
s[0] = 'u';
|
|
|
|
s = names->usb_ports;
|
2013-01-09 19:06:46 +01:00
|
|
|
l = strpcpyl(&s, sizeof(names->usb_ports), "u", ports, NULL);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
|
|
|
/* append USB config number, suppress the common config == 1 */
|
|
|
|
if (!streq(config, "1"))
|
2013-01-09 19:06:46 +01:00
|
|
|
l = strpcpyl(&s, sizeof(names->usb_ports), "c", config, NULL);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
|
|
|
/* append USB interface number, suppress the interface == 0 */
|
|
|
|
if (!streq(interf, "0"))
|
2013-01-09 19:06:46 +01:00
|
|
|
l = strpcpyl(&s, sizeof(names->usb_ports), "i", interf, NULL);
|
2012-12-06 20:42:49 +01:00
|
|
|
if (l == 0)
|
|
|
|
return -ENAMETOOLONG;
|
|
|
|
|
|
|
|
names->type = NET_USB;
|
2012-11-20 18:10:45 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-01-17 02:09:49 +01:00
|
|
|
static int names_bcma(struct udev_device *dev, struct netnames *names) {
|
|
|
|
struct udev_device *bcmadev;
|
|
|
|
unsigned int core;
|
|
|
|
|
2015-06-02 16:52:07 +02:00
|
|
|
assert(dev);
|
|
|
|
assert(names);
|
|
|
|
|
2013-01-17 02:09:49 +01:00
|
|
|
bcmadev = udev_device_get_parent_with_subsystem_devtype(dev, "bcma", NULL);
|
|
|
|
if (!bcmadev)
|
|
|
|
return -ENOENT;
|
|
|
|
|
2013-01-17 03:30:07 +01:00
|
|
|
/* bus num:core num */
|
2013-12-15 22:26:27 +01:00
|
|
|
if (sscanf(udev_device_get_sysname(bcmadev), "bcma%*u:%u", &core) != 1)
|
2013-01-17 02:09:49 +01:00
|
|
|
return -EINVAL;
|
2013-01-17 03:30:07 +01:00
|
|
|
/* suppress the common core == 0 */
|
|
|
|
if (core > 0)
|
2016-01-12 15:34:20 +01:00
|
|
|
xsprintf(names->bcma_core, "b%u", core);
|
2013-01-17 03:30:07 +01:00
|
|
|
|
2013-01-17 02:09:49 +01:00
|
|
|
names->type = NET_BCMA;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
static int names_ccw(struct udev_device *dev, struct netnames *names) {
|
|
|
|
struct udev_device *cdev;
|
2017-02-19 09:00:42 +01:00
|
|
|
const char *bus_id, *subsys;
|
2014-01-09 11:28:12 +01:00
|
|
|
size_t bus_id_len;
|
2017-02-17 16:18:01 +01:00
|
|
|
size_t bus_id_start;
|
2014-01-09 11:28:12 +01:00
|
|
|
|
2015-06-02 16:52:07 +02:00
|
|
|
assert(dev);
|
|
|
|
assert(names);
|
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
/* Retrieve the associated CCW device */
|
|
|
|
cdev = udev_device_get_parent(dev);
|
2017-02-17 16:18:01 +01:00
|
|
|
/* skip virtio subsystem if present */
|
|
|
|
cdev = skip_virtio(cdev);
|
2014-01-09 11:28:12 +01:00
|
|
|
if (!cdev)
|
|
|
|
return -ENOENT;
|
|
|
|
|
2017-02-17 16:18:01 +01:00
|
|
|
/* Network devices are either single or grouped CCW devices */
|
|
|
|
subsys = udev_device_get_subsystem(cdev);
|
|
|
|
if (!STRPTR_IN_SET(subsys, "ccwgroup", "ccw"))
|
2014-01-09 11:28:12 +01:00
|
|
|
return -ENOENT;
|
|
|
|
|
2017-02-17 16:18:01 +01:00
|
|
|
/* Retrieve bus-ID of the CCW device. The bus-ID uniquely
|
2014-01-09 11:28:12 +01:00
|
|
|
* identifies the network device on the Linux on System z channel
|
|
|
|
* subsystem. Note that the bus-ID contains lowercase characters.
|
|
|
|
*/
|
|
|
|
bus_id = udev_device_get_sysname(cdev);
|
|
|
|
if (!bus_id)
|
|
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
/* Check the length of the bus-ID. Rely on that the kernel provides
|
|
|
|
* a correct bus-ID; alternatively, improve this check and parse and
|
|
|
|
* verify each bus-ID part...
|
|
|
|
*/
|
|
|
|
bus_id_len = strlen(bus_id);
|
2017-12-25 05:38:49 +01:00
|
|
|
if (!IN_SET(bus_id_len, 8, 9))
|
2014-01-09 11:28:12 +01:00
|
|
|
return -EINVAL;
|
|
|
|
|
2016-01-29 17:54:30 +01:00
|
|
|
/* Strip leading zeros from the bus id for aesthetic purposes. This
|
|
|
|
* keeps the ccw names stable, yet much shorter in general case of
|
|
|
|
* bus_id 0.0.0600 -> 600. This is similar to e.g. how PCI domain is
|
2017-02-17 16:18:01 +01:00
|
|
|
* not prepended when it is zero. Preserve the last 0 for 0.0.0000.
|
2016-01-29 17:54:30 +01:00
|
|
|
*/
|
2017-02-17 16:18:01 +01:00
|
|
|
bus_id_start = strspn(bus_id, ".0");
|
|
|
|
bus_id += bus_id_start < bus_id_len ? bus_id_start : bus_id_len - 1;
|
2016-01-29 17:54:30 +01:00
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
/* Store the CCW bus-ID for use as network device name */
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (snprintf_ok(names->ccw_busid, sizeof(names->ccw_busid), "c%s", bus_id))
|
2017-02-17 16:18:01 +01:00
|
|
|
names->type = NET_CCW;
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
static int names_mac(struct udev_device *dev, struct netnames *names) {
|
2012-11-20 18:10:45 +01:00
|
|
|
const char *s;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int a1, a2, a3, a4, a5, a6;
|
|
|
|
|
|
|
|
/* check for NET_ADDR_PERM, skip random MAC addresses */
|
|
|
|
s = udev_device_get_sysattr_value(dev, "addr_assign_type");
|
|
|
|
if (!s)
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
i = strtoul(s, NULL, 0);
|
|
|
|
if (i != 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
s = udev_device_get_sysattr_value(dev, "address");
|
|
|
|
if (!s)
|
|
|
|
return -ENOENT;
|
|
|
|
if (sscanf(s, "%x:%x:%x:%x:%x:%x", &a1, &a2, &a3, &a4, &a5, &a6) != 6)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/* skip empty MAC addresses */
|
|
|
|
if (a1 + a2 + a3 + a4 + a5 + a6 == 0)
|
2012-11-09 12:37:40 +01:00
|
|
|
return -EINVAL;
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
names->mac[0] = a1;
|
|
|
|
names->mac[1] = a2;
|
|
|
|
names->mac[2] = a3;
|
|
|
|
names->mac[3] = a4;
|
|
|
|
names->mac[4] = a5;
|
|
|
|
names->mac[5] = a6;
|
|
|
|
names->mac_valid = true;
|
|
|
|
return 0;
|
|
|
|
}
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
/* IEEE Organizationally Unique Identifier vendor string */
|
|
|
|
static int ieee_oui(struct udev_device *dev, struct netnames *names, bool test) {
|
2012-12-06 21:37:10 +01:00
|
|
|
char str[32];
|
2012-12-06 20:42:49 +01:00
|
|
|
|
2012-12-06 21:37:10 +01:00
|
|
|
if (!names->mac_valid)
|
2012-12-06 20:42:49 +01:00
|
|
|
return -ENOENT;
|
|
|
|
/* skip commonly misused 00:00:00 (Xerox) prefix */
|
|
|
|
if (memcmp(names->mac, "\0\0\0", 3) == 0)
|
|
|
|
return -EINVAL;
|
2016-01-12 15:34:20 +01:00
|
|
|
xsprintf(str, "OUI:%02X%02X%02X%02X%02X%02X", names->mac[0],
|
|
|
|
names->mac[1], names->mac[2], names->mac[3], names->mac[4],
|
|
|
|
names->mac[5]);
|
2013-07-08 11:44:17 +02:00
|
|
|
udev_builtin_hwdb_lookup(dev, NULL, str, NULL, test);
|
2012-12-06 20:42:49 +01:00
|
|
|
return 0;
|
2012-11-09 12:37:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool test) {
|
2012-11-20 18:10:45 +01:00
|
|
|
const char *s;
|
2013-01-08 14:54:12 +01:00
|
|
|
const char *p;
|
2012-11-20 18:10:45 +01:00
|
|
|
unsigned int i;
|
|
|
|
const char *devtype;
|
|
|
|
const char *prefix = "en";
|
2013-03-25 00:59:00 +01:00
|
|
|
struct netnames names = {};
|
2012-12-06 20:42:49 +01:00
|
|
|
int err;
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
/* handle only ARPHRD_ETHER and ARPHRD_SLIP devices */
|
2012-11-20 18:10:45 +01:00
|
|
|
s = udev_device_get_sysattr_value(dev, "type");
|
|
|
|
if (!s)
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
i = strtoul(s, NULL, 0);
|
2014-01-09 11:28:12 +01:00
|
|
|
switch (i) {
|
2014-04-06 18:00:26 +02:00
|
|
|
case ARPHRD_ETHER:
|
2014-01-09 11:28:12 +01:00
|
|
|
prefix = "en";
|
|
|
|
break;
|
2014-04-06 18:00:26 +02:00
|
|
|
case ARPHRD_SLIP:
|
2014-01-09 11:28:12 +01:00
|
|
|
prefix = "sl";
|
|
|
|
break;
|
|
|
|
default:
|
2012-11-20 18:10:45 +01:00
|
|
|
return 0;
|
2014-01-09 11:28:12 +01:00
|
|
|
}
|
2012-11-20 18:10:45 +01:00
|
|
|
|
2013-01-08 14:54:12 +01:00
|
|
|
/* skip stacked devices, like VLANs, ... */
|
|
|
|
s = udev_device_get_sysattr_value(dev, "ifindex");
|
|
|
|
if (!s)
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
p = udev_device_get_sysattr_value(dev, "iflink");
|
|
|
|
if (!p)
|
|
|
|
return EXIT_FAILURE;
|
2013-02-13 18:13:22 +01:00
|
|
|
if (!streq(s, p))
|
2013-01-08 14:54:12 +01:00
|
|
|
return 0;
|
|
|
|
|
2012-11-20 18:10:45 +01:00
|
|
|
devtype = udev_device_get_devtype(dev);
|
|
|
|
if (devtype) {
|
|
|
|
if (streq("wlan", devtype))
|
|
|
|
prefix = "wl";
|
|
|
|
else if (streq("wwan", devtype))
|
|
|
|
prefix = "ww";
|
|
|
|
}
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
err = names_mac(dev, &names);
|
|
|
|
if (err >= 0 && names.mac_valid) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
2016-01-12 15:34:20 +01:00
|
|
|
xsprintf(str, "%sx%02x%02x%02x%02x%02x%02x", prefix,
|
2012-12-06 20:42:49 +01:00
|
|
|
names.mac[0], names.mac[1], names.mac[2],
|
|
|
|
names.mac[3], names.mac[4], names.mac[5]);
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_MAC", str);
|
|
|
|
|
|
|
|
ieee_oui(dev, &names, test);
|
|
|
|
}
|
|
|
|
|
2014-01-09 11:28:12 +01:00
|
|
|
/* get path names for Linux on System z network devices */
|
|
|
|
err = names_ccw(dev, &names);
|
2017-02-17 16:18:01 +01:00
|
|
|
if (err >= 0 && names.type == NET_CCW) {
|
2014-01-09 11:28:12 +01:00
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.ccw_busid))
|
2014-01-09 11:28:12 +01:00
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
2017-03-31 16:32:09 +02:00
|
|
|
/* get ibmveth/ibmvnic slot-based names. */
|
|
|
|
err = names_vio(dev, &names);
|
|
|
|
if (err >= 0 && names.type == NET_VIO) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.vio_slot))
|
2017-03-31 16:32:09 +02:00
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
2017-05-17 15:28:35 +02:00
|
|
|
/* get ACPI path names for ARM64 platform devices */
|
|
|
|
err = names_platform(dev, &names, test);
|
|
|
|
if (err >= 0 && names.type == NET_PLATFORM) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (snprintf_ok(str, sizeof str, "%s%s", prefix, names.platform_path))
|
2017-05-17 15:28:35 +02:00
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
2012-12-06 20:42:49 +01:00
|
|
|
/* get PCI based path names, we compose only PCI based paths */
|
|
|
|
err = names_pci(dev, &names);
|
|
|
|
if (err < 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
/* plain PCI device */
|
|
|
|
if (names.type == NET_PCI) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_onboard[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_onboard))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_ONBOARD", str);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_onboard_label &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_onboard_label))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_LABEL_ONBOARD", str);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_path[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_path))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_slot[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s", prefix, names.pci_slot))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
2012-12-06 20:42:49 +01:00
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* USB device */
|
|
|
|
err = names_usb(dev, &names);
|
|
|
|
if (err >= 0 && names.type == NET_USB) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_path[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s%s", prefix, names.pci_path, names.usb_ports))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
2012-12-06 20:42:49 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_slot[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s%s", prefix, names.pci_slot, names.usb_ports))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
2013-01-17 02:09:49 +01:00
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Broadcom bus */
|
|
|
|
err = names_bcma(dev, &names);
|
|
|
|
if (err >= 0 && names.type == NET_BCMA) {
|
|
|
|
char str[IFNAMSIZ];
|
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_path[0] &&
|
|
|
|
snprintf_ok(str, sizeof str, "%s%s%s", prefix, names.pci_path, names.bcma_core))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
|
2013-01-17 02:09:49 +01:00
|
|
|
|
udev/net-id: check all snprintf return values
gcc-8 throws an error if it knows snprintf might truncate output and the
return value is ignored:
../src/udev/udev-builtin-net_id.c: In function 'dev_pci_slot':
../src/udev/udev-builtin-net_id.c:297:47: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~
../src/udev/udev-builtin-net_id.c:297:17: note: 'snprintf' output between 10 and 4360 bytes into a destination of size 4096
snprintf(str, sizeof str, "%s/%s/address", slots, dent->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Let's check all return values. This actually makes the code better, because there's
no point in trying to open a file when the name has been truncated, etc.
2018-02-23 11:12:19 +01:00
|
|
|
if (names.pci_slot[0] &&
|
|
|
|
snprintf(str, sizeof str, "%s%s%s", prefix, names.pci_slot, names.bcma_core))
|
|
|
|
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
|
2013-01-17 02:09:49 +01:00
|
|
|
goto out;
|
2012-12-06 20:42:49 +01:00
|
|
|
}
|
|
|
|
out:
|
2012-11-09 12:37:40 +01:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
const struct udev_builtin udev_builtin_net_id = {
|
|
|
|
.name = "net_id",
|
|
|
|
.cmd = builtin_net_id,
|
2015-01-05 13:19:55 +01:00
|
|
|
.help = "Network device properties",
|
2012-11-09 12:37:40 +01:00
|
|
|
};
|