Skip to content

Commit

Permalink
convert macaddress only nictype is delegatedvmnic
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyufan2 committed May 23, 2024
1 parent a1af26a commit 0a9c272
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network/endpoint_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ func (nw *network) configureHcnEndpoint(epInfo *EndpointInfo) (*hcn.HostComputeE
}

// macAddress type for InfraNIC is like "60:45:bd:12:45:65"
// if NICType is delegatedVMNIC, convert the macaddress format
macAddress := epInfo.MacAddress.String()
if epInfo.NICType != cns.InfraNIC {
if epInfo.NICType == cns.DelegatedVMNIC {
// convert the format of macAddress that HNS can accept, i.e, "60-45-bd-12-45-65" if NIC type is delegated NIC
macAddress = strings.Join(strings.Split(macAddress, ":"), "-")
}
Expand Down

0 comments on commit 0a9c272

Please sign in to comment.