mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
[PATCH] fix network device naming bug
This commit is contained in:
parent
162c0ee8b9
commit
8825e9e71b
13
udev_lib.c
13
udev_lib.c
@ -40,6 +40,7 @@ void udev_set_values(struct udevice *udev, const char* devpath,
|
|||||||
const char *subsystem, const char* action)
|
const char *subsystem, const char* action)
|
||||||
{
|
{
|
||||||
memset(udev, 0x00, sizeof(struct udevice));
|
memset(udev, 0x00, sizeof(struct udevice));
|
||||||
|
|
||||||
if (devpath)
|
if (devpath)
|
||||||
strfieldcpy(udev->devpath, devpath);
|
strfieldcpy(udev->devpath, devpath);
|
||||||
if (subsystem)
|
if (subsystem)
|
||||||
@ -49,17 +50,13 @@ void udev_set_values(struct udevice *udev, const char* devpath,
|
|||||||
|
|
||||||
if (strcmp(udev->subsystem, "block") == 0)
|
if (strcmp(udev->subsystem, "block") == 0)
|
||||||
udev->type = 'b';
|
udev->type = 'b';
|
||||||
|
else if (strcmp(udev->subsystem, "net") == 0)
|
||||||
if (strcmp(udev->subsystem, "net") == 0)
|
|
||||||
udev->type = 'n';
|
udev->type = 'n';
|
||||||
|
else if (strncmp(udev->devpath, "/block/", 7) == 0)
|
||||||
if (strncmp(udev->devpath, "/block/", 7) == 0)
|
|
||||||
udev->type = 'b';
|
udev->type = 'b';
|
||||||
|
else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
|
||||||
if (strncmp(udev->devpath, "/class/net/", 11) == 0)
|
|
||||||
udev->type = 'n';
|
udev->type = 'n';
|
||||||
|
else if (strncmp(udev->devpath, "/class/", 7) == 0)
|
||||||
if (strncmp(udev->devpath, "/class/", 7) == 0)
|
|
||||||
udev->type = 'c';
|
udev->type = 'c';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user