chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dee4c24
)
udev: net_id - skip stacked network devices
author
Kay Sievers
<kay@vrfy.org>
Tue, 8 Jan 2013 13:54:12 +0000
(14:54 +0100)
committer
Kay Sievers
<kay@vrfy.org>
Tue, 8 Jan 2013 13:54:12 +0000
(14:54 +0100)
src/udev/udev-builtin-net_id.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-builtin-net_id.c
b/src/udev/udev-builtin-net_id.c
index d5db762e80cfa0264f319a6b36a86f5ecba38419..1975c6d62c5af6e7db918a4ca45d817f47fef4ea 100644
(file)
--- a/
src/udev/udev-builtin-net_id.c
+++ b/
src/udev/udev-builtin-net_id.c
@@
-366,6
+366,7
@@
static int ieee_oui(struct udev_device *dev, struct netnames *names, bool test)
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool test) {
const char *s;
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool test) {
const char *s;
+ const char *p;
unsigned int i;
const char *devtype;
const char *prefix = "en";
unsigned int i;
const char *devtype;
const char *prefix = "en";
@@
-380,6
+381,16
@@
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
if (i != 1)
return 0;
if (i != 1)
return 0;
+ /* 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;
+ if (strcmp(s, p) != 0)
+ return 0;
+
devtype = udev_device_get_devtype(dev);
if (devtype) {
if (streq("wlan", devtype))
devtype = udev_device_get_devtype(dev);
if (devtype) {
if (streq("wlan", devtype))