david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[ecm] Display invalid MAC address strings in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-06-14 17:40:05 +01:00
parent 7c395b0e21
commit c8cb867d65
1 changed files with 6 additions and 1 deletions

View File

@ -101,13 +101,18 @@ int ecm_fetch_mac ( struct usb_device *usb,
}
/* Sanity check */
if ( len != ( ( int ) ( sizeof ( buf ) - 1 /* NUL */ ) ) )
if ( len != ( ( int ) ( sizeof ( buf ) - 1 /* NUL */ ) ) ) {
DBGC ( usb, "USB %s has invalid ECM MAC \"%s\"\n",
usb->name, buf );
return -EINVAL;
}
/* Decode MAC address */
len = base16_decode ( buf, hw_addr, ETH_ALEN );
if ( len < 0 ) {
rc = len;
DBGC ( usb, "USB %s could not decode ECM MAC \"%s\": %s\n",
usb->name, buf, strerror ( rc ) );
return rc;
}