summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-19 22:42:19 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 22:30:28 -0700
commit8825e9e71b3eaac8ce90f4fede2bb07a7ea7a969 (patch)
treeacad10c6e81b87be44080a0ce387dbf85c6dcc70
parent162c0ee8b95228676a83aaaaf5adf64ba56b0be8 (diff)
[PATCH] fix network device naming bug
-rw-r--r--udev_lib.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/udev_lib.c b/udev_lib.c
index d745c9bd86..f388d23f3e 100644
--- a/udev_lib.c
+++ b/udev_lib.c
@@ -40,6 +40,7 @@ void udev_set_values(struct udevice *udev, const char* devpath,
const char *subsystem, const char* action)
{
memset(udev, 0x00, sizeof(struct udevice));
+
if (devpath)
strfieldcpy(udev->devpath, devpath);
if (subsystem)
@@ -49,17 +50,13 @@ void udev_set_values(struct udevice *udev, const char* devpath,
if (strcmp(udev->subsystem, "block") == 0)
udev->type = 'b';
-
- if (strcmp(udev->subsystem, "net") == 0)
+ else if (strcmp(udev->subsystem, "net") == 0)
udev->type = 'n';
-
- if (strncmp(udev->devpath, "/block/", 7) == 0)
+ else if (strncmp(udev->devpath, "/block/", 7) == 0)
udev->type = 'b';
-
- if (strncmp(udev->devpath, "/class/net/", 11) == 0)
+ else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
udev->type = 'n';
-
- if (strncmp(udev->devpath, "/class/", 7) == 0)
+ else if (strncmp(udev->devpath, "/class/", 7) == 0)
udev->type = 'c';
}