Revert "ifconfig: abort if loading a module fails other than for ENOENT"

This reverts commit 2c24ad3377.

This change causes some commands to fail, for example when working with
renamed interfaces or when trying to list a nonexistent interface by
name.

PR:		269042
Reported by:	dbaio, Michael Paepcke <bugs.fbsd@paepcke.de>
MFC with:	2c24ad3377
This commit is contained in:
Alan Somers 2023-01-20 10:17:21 -07:00
parent 34ac629b40
commit 5205908816

View File

@ -1719,19 +1719,11 @@ ifmaybeload(const char *name)
}
}
/* Try to load the module. */
if (kldload(ifkind) < 0) {
switch (errno) {
case ENOENT:
/*
* Ignore ENOENT, because ifconfig can't infer the
* names of all drivers (eg mlx4en(4)).
*/
break;
default:
err(1, "kldload(%s)", ifkind);
}
}
/*
* Try to load the module. But ignore failures, because ifconfig can't
* infer the names of all drivers (eg mlx4en(4)).
*/
(void) kldload(ifkind);
}
static struct cmd basic_cmds[] = {