瀏覽代碼

[ecm] Display invalid MAC address strings in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 年之前
父節點
當前提交
c8cb867d65
共有 1 個檔案被更改,包括 6 行新增1 行删除
  1. 6
    1
      src/drivers/net/ecm.c

+ 6
- 1
src/drivers/net/ecm.c 查看文件

@@ -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…
取消
儲存