From f24faa98dc35104af07ebc288472f4b7cf9fb1e7 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Wed, 3 May 2017 19:53:01 +0000 Subject: [PATCH] Unbreak ifconfig for mlx4en(4) after r317755 ifconfig doesn't correctly infer mlx interfaces' module names, so it will attempt to load the mlx(4) module even when not necessary. Reported by: rstone MFC after: 3 weeks X-MFC-With: 317755 Sponsored by: Spectra Logic Corp --- sbin/ifconfig/ifconfig.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 94ebfaf1ffb..7f3289a8749 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1374,9 +1374,11 @@ ifmaybeload(const char *name) } } - /* not present, we should try to load it */ - if (kldload(ifkind) < 0) - 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[] = {