Changeset View
Changeset View
Standalone View
Standalone View
sbin/ifconfig/ifconfig.c
Show First 20 Lines • Show All 1,713 Lines • ▼ Show 20 Lines | for (modid = kldfirstmod(fileid); modid > 0; | ||||
* so could lead to conflicts not trivially solved. | * so could lead to conflicts not trivially solved. | ||||
*/ | */ | ||||
if ((!found && strcmp(ifname, cp) == 0) || | if ((!found && strcmp(ifname, cp) == 0) || | ||||
strcmp(ifkind, cp) == 0) | strcmp(ifkind, cp) == 0) | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
/* Try to load the module. */ | |||||
if (kldload(ifkind) < 0) { | |||||
switch (errno) { | |||||
case ENOENT: | |||||
/* | /* | ||||
* Try to load the module. But ignore failures, because ifconfig can't | * Ignore ENOENT, because ifconfig can't infer the | ||||
* infer the names of all drivers (eg mlx4en(4)). | * names of all drivers (eg mlx4en(4)). | ||||
*/ | */ | ||||
(void) kldload(ifkind); | break; | ||||
default: | |||||
err(1, "kldload(%s)", ifkind); | |||||
} | |||||
} | |||||
} | } | ||||
static struct cmd basic_cmds[] = { | static struct cmd basic_cmds[] = { | ||||
DEF_CMD("up", IFF_UP, setifflags), | DEF_CMD("up", IFF_UP, setifflags), | ||||
DEF_CMD("down", -IFF_UP, setifflags), | DEF_CMD("down", -IFF_UP, setifflags), | ||||
DEF_CMD("arp", -IFF_NOARP, setifflags), | DEF_CMD("arp", -IFF_NOARP, setifflags), | ||||
DEF_CMD("-arp", IFF_NOARP, setifflags), | DEF_CMD("-arp", IFF_NOARP, setifflags), | ||||
DEF_CMD("debug", IFF_DEBUG, setifflags), | DEF_CMD("debug", IFF_DEBUG, setifflags), | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |