Subject: bin/5778: sysinst can't configure epic cards
To: None <gnats-bugs@gnats.netbsd.org>
From: None <John.P.Darrow@wheaton.edu>
List: netbsd-bugs
Date: 07/16/1998 17:01:16
>Number: 5778
>Category: bin
>Synopsis: sysinst can't configure epic cards
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 16 15:20:01 1998
>Last-Modified:
>Originator: John Darrow
>Organization:
Computing Services
Wheaton College, Wheaton, IL
>Release: NetBSD-current as of 19980715
>Environment:
System: NetBSD jdarrow.wheaton.edu 1.3F NetBSD 1.3F (JDARROW) #1: Tue Jul 14 12:12:56 CDT 1998 jdarrow@jdarrow.wheaton.edu:/var/src/sys/arch/i386/compile/JDARROW i386
>Description:
Sysinst's 'configure network' option fails to work correctly with
the epic network driver, due to the driver name's length.
As a result, the user is stuck in the 'which network device' dialog
with no way out except to quit sysinst.
There is a curious little comparison in net.c which checks
strlen(net_dev) against 4 and 5 before even comparing it against
the valid devices. (net_dev is the network driver name and number
followed by a space, e.g. "epic0 "). This works fine with two-
and three-character network drivers (such as ep or fxp) but fails
with epic. The fix below changes this to check < 4 or > 6, but it
still seems to be a hack, and could cause future breakage if we
ever get any network drivers with five-character names...
>How-To-Repeat:
Boot INSTALL kernel built from current-19980715, choose 'Configure
network' from the Utility menu, try to enter (or choose as default)
epic0, get the 'badnet' message, get sent back to the 'Which device'
question, with no way out...
>Fix:
*** /var/src-changes/distrib/utils/sysinst/net.c_v1.31 Mon Jul 6 06:05:32 1998
--- /var/src-changes/distrib/utils/sysinst/net.c Thu Jul 16 16:28:10 1998
***************
*** 157,163 ****
strsep(&tp, " ");
net_dev[strlen(net_dev)+1] = 0;
net_dev[strlen(net_dev)] = ' ';
! while ((strlen(net_dev) != 4 && strlen(net_dev) != 5) ||
strstr(net_devices, net_dev) == NULL) {
msg_prompt(MSG_badnet, defname, net_dev, 10, net_devices);
tp = net_dev;
--- 157,163 ----
strsep(&tp, " ");
net_dev[strlen(net_dev)+1] = 0;
net_dev[strlen(net_dev)] = ' ';
! while ((strlen(net_dev) < 4 || strlen(net_dev) > 6) || /* XXX */
strstr(net_devices, net_dev) == NULL) {
msg_prompt(MSG_badnet, defname, net_dev, 10, net_devices);
tp = net_dev;
>Audit-Trail:
>Unformatted: