mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 06:15:33 -04:00
libefivar: Fix the wrong MAC address length
Network interface type should be checked before the conversion between
text device path node and MAC device path. Otherwise, the MAC text string
can't be converted to the representation of a device node, which leads to
the series failure of network HII configuration(e.g. IP, VLAN, HTTP Boot
configuration in Network Device List).
Obtained from: 2d67f2bae3
Pull Request: https://github.com/freebsd/freebsd-src/pull/581
This commit is contained in:
parent
bff83dd395
commit
81a659e364
1 changed files with 4 additions and 0 deletions
|
|
@ -1920,6 +1920,10 @@ DevPathFromTextMAC (
|
|||
MACDevPath->IfType = (UINT8) Strtoi (IfTypeStr);
|
||||
|
||||
Length = sizeof (EFI_MAC_ADDRESS);
|
||||
if (MACDevPath->IfType == 0x01 || MACDevPath->IfType == 0x00) {
|
||||
Length = 6;
|
||||
}
|
||||
|
||||
StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length);
|
||||
|
||||
return (EFI_DEVICE_PATH_PROTOCOL *) MACDevPath;
|
||||
|
|
|
|||
Loading…
Reference in a new issue