Browse Source

[ecm] Display invalid MAC address strings in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
c8cb867d65
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      src/drivers/net/ecm.c

+ 6
- 1
src/drivers/net/ecm.c View File

@@ -101,13 +101,18 @@ int ecm_fetch_mac ( struct usb_device *usb,
101 101
 	}
102 102
 
103 103
 	/* Sanity check */
104
-	if ( len != ( ( int ) ( sizeof ( buf ) - 1 /* NUL */ ) ) )
104
+	if ( len != ( ( int ) ( sizeof ( buf ) - 1 /* NUL */ ) ) ) {
105
+		DBGC ( usb, "USB %s has invalid ECM MAC \"%s\"\n",
106
+		       usb->name, buf );
105 107
 		return -EINVAL;
108
+	}
106 109
 
107 110
 	/* Decode MAC address */
108 111
 	len = base16_decode ( buf, hw_addr, ETH_ALEN );
109 112
 	if ( len < 0 ) {
110 113
 		rc = len;
114
+		DBGC ( usb, "USB %s could not decode ECM MAC \"%s\": %s\n",
115
+		       usb->name, buf, strerror ( rc ) );
111 116
 		return rc;
112 117
 	}
113 118
 

Loading…
Cancel
Save