Fix the ``WARNING: Driver mistake: repeat make_dev'', caused by using

the wrong index variable within a loop.  I have no idea how this managed
to work on my test box.

Spotted by: fenner
This commit is contained in:
Jonathan Lemon 2001-10-11 18:39:05 +00:00
parent 458c32f2e8
commit d2b4566aa6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84817

View File

@ -41,6 +41,7 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/mbuf.h>
#include <sys/systm.h>
#include <sys/proc.h>
@ -308,7 +309,7 @@ if_findindex(struct ifnet *ifp)
{
int i, unit;
char eaddr[18], devname[32];
char *name, *p;
const char *name, *p;
switch (ifp->if_type) {
case IFT_ETHER: /* these types use struct arpcom */
@ -343,7 +344,7 @@ if_findindex(struct ifnet *ifp)
name, unit, devname);
}
for (unit = 1; ; unit++) {
if (unit < if_index && ifaddr_byindex(i) != NULL)
if (unit < if_index && ifaddr_byindex(unit) != NULL)
continue;
if (resource_string_value(name, unit, "ether", &p) == 0 ||
resource_string_value(name, unit, "dev", &p) == 0)