Skip to content

Commit

Permalink
[ecm] Display invalid MAC address strings in debug messages
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jun 14, 2017
1 parent 7c395b0 commit c8cb867
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/drivers/net/ecm.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit c8cb867

Please sign in to comment.