Index: usr.sbin/bhyve/net_backends.c =================================================================== --- usr.sbin/bhyve/net_backends.c +++ usr.sbin/bhyve/net_backends.c @@ -980,7 +980,7 @@ void *param) { struct net_backend **pbe, *nbe, *tbe = NULL; - const char *value; + const char *value, *type; char *devname; int err; @@ -990,12 +990,22 @@ } devname = strdup(value); + /* Derive the backend by devname prefix by default */ + type = devname; + + value = get_config_value_node(nvl, "type"); + + /* Use the explicitly specified backend if such configuration exists */ + if (value != NULL) { + type = value; + } + /* * Find the network backend that matches the user-provided * device name. net_backend_set is built using a linker set. */ SET_FOREACH(pbe, net_backend_set) { - if (strncmp(devname, (*pbe)->prefix, + if (strncmp(type, (*pbe)->prefix, strlen((*pbe)->prefix)) == 0) { tbe = *pbe; assert(tbe->init != NULL);