summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-event.c2
-rw-r--r--udev/udev-rules.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c
index f41f06b16a..02a1767b1f 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -564,7 +564,7 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules)
udev_rules_apply_to_event(rules, event);
/* rename a new network interface, if needed */
- if (strcmp(udev_device_get_subsystem(dev), "net") == 0 && strcmp(udev_device_get_action(dev), "add") == 0 &&
+ if (udev_device_get_ifindex(dev) > 0 && strcmp(udev_device_get_action(dev), "add") == 0 &&
event->name != NULL && strcmp(event->name, udev_device_get_sysname(dev)) != 0) {
char syspath[UTIL_PATH_SIZE];
char *pos;
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index ab7b6aedb9..6b473c4c2e 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -2080,7 +2080,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
can_set_name = ((strcmp(udev_device_get_action(event->dev), "remove") != 0) &&
(major(udev_device_get_devnum(event->dev)) > 0 ||
- strcmp(udev_device_get_subsystem(event->dev), "net") == 0));
+ udev_device_get_ifindex(event->dev) > 0));
/* loop through token list, match, run actions or forward to next rule */
cur = &rules->tokens[0];