Newer kernels provide the 'net' link as a directory, instead of the 'net:XX' link with previous kernels. The sysfs scanning code has enablement to work with this, but the directory lookup doesn't work properly.
References: bnc#561596 Signed-off-by: Hannes Reinecke <[email protected]> diff --git a/utils/fwparam_ibft/fwparam_ibft_sysfs.c b/utils/fwparam_ibft/fwparam_ibft_sysfs.c index 98e29a6..e44460d 100644 --- a/utils/fwparam_ibft/fwparam_ibft_sysfs.c +++ b/utils/fwparam_ibft/fwparam_ibft_sysfs.c @@ -80,7 +80,7 @@ static int find_sysfs_dirs(const char *fpath, const struct stat *sb, static int get_iface_from_device(char *id, struct boot_context *context) { char dev_dir[FILENAMESZ]; - int rc = ENODEV; + int rc = EOPNOTSUPP; DIR *dirfd; struct dirent *dent; @@ -95,8 +95,7 @@ static int get_iface_from_device(char *id, struct boot_context *context) return errno; while ((dent = readdir(dirfd))) { - if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..") || - strncmp(dent->d_name, "net", 3)) + if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) continue; if (!strncmp(dent->d_name, "net:", 4)) { @@ -112,17 +111,19 @@ static int get_iface_from_device(char *id, struct boot_context *context) rc = EINVAL; rc = 0; break; - } else { - printf("Could not read ethernet to net link\n."); - rc = EOPNOTSUPP; + } + if (!strcmp(dent->d_name, "net")) { + rc = ENODEV; break; } } closedir(dirfd); - if (rc != ENODEV) + if (rc != ENODEV) { + printf("Could not read ethernet to net link\n."); return rc; + } /* If not found try again with newer kernel networkdev sysfs layout */ strlcat(dev_dir, "/net", FILENAMESZ); -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.
