aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-09-04 13:32:05 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-09-05 23:18:51 +0200
commit4411652aead3509ce497e4598f533e2b7e4f4ba0 (patch)
tree0c62ef7a68a3ddf32604ef1589d035c8daf1211b /lib
parent8254f8feb71a93a4d87aa68d900660ef445d44cd (diff)
downloadu-boot-4411652aead3509ce497e4598f533e2b7e4f4ba0.zip
u-boot-4411652aead3509ce497e4598f533e2b7e4f4ba0.tar.gz
u-boot-4411652aead3509ce497e4598f533e2b7e4f4ba0.tar.bz2
efi_loader: correctly render MAC address device path nodes
If the interface type is greater 1 render all 32 bytes of the MAC address. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index 133542a..892f5c4 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -124,17 +124,16 @@ static char *dp_msging(char *s, struct efi_device_path *dp)
break;
}
case DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR: {
+ int i, n = sizeof(struct efi_mac_addr);
struct efi_device_path_mac_addr *mdp =
(struct efi_device_path_mac_addr *)dp;
- if (mdp->if_type != 0 && mdp->if_type != 1)
- break;
-
- s += sprintf(s, "MAC(%02x%02x%02x%02x%02x%02x,0x%1x)",
- mdp->mac.addr[0], mdp->mac.addr[1],
- mdp->mac.addr[2], mdp->mac.addr[3],
- mdp->mac.addr[4], mdp->mac.addr[5],
- mdp->if_type);
+ if (mdp->if_type <= 1)
+ n = 6;
+ s += sprintf(s, "MAC(");
+ for (i = 0; i < n; ++i)
+ s += sprintf(s, "%02x", mdp->mac.addr[i]);
+ s += sprintf(s, ",%u)", mdp->if_type);
break;
}