Re: [ANNOUNCE] udev 046 release

From: Kay Sievers
Date: Fri Nov 19 2004 - 09:43:15 EST


On Fri, 2004-11-19 at 12:26 +0100, Mathieu Segaud wrote:
> seems like these changes broke something in rules applying to eth* devices.
> the rules put and still working with udev 045 have no effect, now....
> not so inconvenient now that I've got just one card in my box, but I guess
> it could be a show-stopper for laptop users.
>
> My rules which can be found at the end of /etc/udev/rules.d/50-udev.rules are:
>
> KERNEL="eth*", SYSFS{address}="00:10:5a:49:36:d8", NAME="external"
> KERNEL="eth*", SYSFS{address}="00:50:04:69:db:56", NAME="private"
> KERNEL="eth*", SYSFS{address}="00:0c:6e:e4:2c:81", NAME="dmz"

This should fix it.

Thanks,
Kay

diff -Nru a/udev_lib.c b/udev_lib.c
--- a/udev_lib.c 2004-11-19 15:40:52 +01:00
+++ b/udev_lib.c 2004-11-19 15:40:52 +01:00
@@ -40,6 +40,7 @@
const char *subsystem, const char* action)
{
memset(udev, 0x00, sizeof(struct udevice));
+
if (devpath)
strfieldcpy(udev->devpath, devpath);
if (subsystem)
@@ -49,17 +50,13 @@

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';
}