diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-05-01 18:15:50 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-05-01 18:15:50 +0000 |
commit | 052b39bb1320091d89f0a64d5ba2a3a35543eaf5 (patch) | |
tree | da1ebd2831a9c278e38c9105ffedf2f924f1dd5f /sys/arch/sparc | |
parent | fca156711298a391cc0ebfd07421bc6f16db992c (diff) |
When parsing the bootpath, correctly handle ":foo" modifiers if they are
more than one-letter wrong; fixes boot device determination with
/.../ledma:tpe/le...
strings (PR #4192)
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/sparc/autoconf.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 82e83456748..357ef31b836 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.66 2005/04/21 00:15:43 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.67 2005/05/01 18:15:46 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -393,9 +393,20 @@ bootpath_build() cp = str2hex(++cp, &bp->val[0]); if (*cp == ',') cp = str2hex(++cp, &bp->val[1]); - if (*cp == ':') - /* XXX - we handle just one char */ - bp->val[2] = *++cp - 'a', ++cp; + if (*cp == ':') { + /* + * We only store one character here, + * as we will only use this field + * to compute a partition index + * for block devices. However, it + * might be an ethernet media + * specification, so be sure to + * skip all letters. + */ + bp->val[2] = *++cp - 'a'; + while (*cp != '\0' && *cp != '/') + cp++; + } } else { bp->val[0] = -1; /* no #'s: assume unit 0, no sbus offset/adddress */ |