Index: head/sys/dev/hyperv/utilities/hv_kvp.c =================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c +++ head/sys/dev/hyperv/utilities/hv_kvp.c @@ -58,7 +58,10 @@ #include #include #include + +#include #include +#include #include #include @@ -306,7 +309,6 @@ int UNUSED_FLAG = 1; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ - char if_name[4]; char buf[HYPERV_GUID_STRLEN]; device_t *devs; @@ -336,11 +338,11 @@ hv_dev = sc->hn_dev_obj; hyperv_guid2str(&hv_dev->device_id, buf, sizeof(buf)); - sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, HYPERV_GUID_STRLEN - 1) == 0) { - strcpy((char *)umsg->body.kvp_ip_val.adapter_id, if_name); + strlcpy((char *)umsg->body.kvp_ip_val.adapter_id, + sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE); break; } }