]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[ecm] Display invalid MAC address strings in debug messages
authorMichael Brown <mcb30@ipxe.org>
Wed, 14 Jun 2017 16:40:05 +0000 (17:40 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 14 Jun 2017 16:40:05 +0000 (17:40 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/ecm.c

index f2d9161c1abece140ee5bfb6a31aa4edde24da62..847a45b85c6f47f32b6c2166797b507dbc351966 100644 (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;
        }