From 8825e9e71b3eaac8ce90f4fede2bb07a7ea7a969 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Fri, 19 Nov 2004 22:42:19 -0800 Subject: [PATCH] [PATCH] fix network device naming bug --- udev_lib.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/udev_lib.c b/udev_lib.c index d745c9bd..f388d23f 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'; } -- 2.39.5