errno = EINVAL;
return -1;
}
+
+ /* :N is an alias */
ep = strchr(spec->drvname, ':');
- if (ep == NULL)
- ep = strchr(spec->drvname, '.');
if (ep) {
spec->lun = (int)strtoi(ep + 1, NULL, 10, 0, INT_MAX, &e);
if (e != 0) {
spec->lun = -1;
ep = spec->drvname + strlen(spec->drvname) - 1;
}
+
strlcpy(spec->devname, spec->drvname, sizeof(spec->devname));
for (ep = spec->drvname; *ep != '\0' && !isdigit((int)*ep); ep++) {
if (*ep == ':') {
}
spec->ppa = (int)strtoi(ep, &pp, 10, 0, INT_MAX, &e);
*ep = '\0';
- if (pp != NULL && *pp == 'i' && spec->lun == -1) {
+
+ /*
+ * . is used for VLAN style names
+ * i is used on NetBSD for xvif interfaces
+ */
+ if (pp != NULL && (*pp == '.' || *pp == 'i') && spec->lun == -1) {
spec->lun = (int)strtoi(pp + 1, NULL, 10, 0, INT_MAX, &e);
if (e)
spec->lun = -1;