[patch 2.4] au1x00 prom.c hw addr case insensitivity fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks,

Attached please find a short fix to str2hexnum() in
arch/mips/au1000/common/prom.c of the 2.4 branch.  With this fix,
the contents of the "ethaddr" entry in the environment table passed
by the bootloader to the kernel can have upper case hexadecimal
digits.  

Without the patch, an address such as ethaddr =
"00:50:C2:0C:20:4f" is silently converted to "00:50:02:00:20:4f",
making for some serious head scratching if you're trying to bootp
the kernel.

Dan
--- arch/mips/au1000/common/prom.c.orig	Tue Feb  4 20:38:28 2003
+++ arch/mips/au1000/common/prom.c	Tue Feb  4 22:09:17 2003
@@ -105,9 +105,11 @@
 inline unsigned char str2hexnum(unsigned char c)
 {
 	if(c >= '0' && c <= '9')
-	return c - '0';
+		return c - '0';
 	if(c >= 'a' && c <= 'f')
-	return c - 'a' + 10;
+		return c - 'a' + 10;
+	if(c >= 'A' && c <= 'F')
+		return c - 'A' + 10;
 	return 0; /* foo */
 }
 

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux