catchup with if_xname change

This commit is contained in:
sam 2003-11-08 01:01:56 +00:00
parent 8a034c943d
commit c40a1d0401

View File

@ -257,15 +257,11 @@ ifnetsetup(const char *interface, u_long off)
return; return;
firstifnet = (u_long)TAILQ_FIRST(&ifnethead); firstifnet = (u_long)TAILQ_FIRST(&ifnethead);
for (off = firstifnet; off;) { for (off = firstifnet; off;) {
char name[16], tname[16]; char name[IFNAMSIZ];
if (kread(off, (char *)&ifnet, sizeof ifnet)) if (kread(off, (char *)&ifnet, sizeof ifnet))
break; break;
if (kread((u_long)ifnet.if_name, tname, sizeof(tname))) if (interface && strcmp(ifnet.if_xname, interface) == 0)
break;
tname[sizeof(tname) - 1] = '\0';
snprintf(name, sizeof(name), "%s%d", tname, ifnet.if_unit);
if (interface && strcmp(name, interface) == 0)
return off; return off;
off = (u_long)TAILQ_NEXT(&ifnet, if_link); off = (u_long)TAILQ_NEXT(&ifnet, if_link);
} }