From: <aot...@us...> - 2004-02-14 17:57:10
|
Update of /cvsroot/gc-linux/linux/arch/ppc/boot/simple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25980/arch/ppc/boot/simple Modified Files: embed_config.c Log Message: Merge 2.6.2 Index: embed_config.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/ppc/boot/simple/embed_config.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- embed_config.c 23 Jan 2004 03:26:19 -0000 1.1.1.1 +++ embed_config.c 14 Feb 2004 17:50:21 -0000 1.2 @@ -51,7 +51,7 @@ { u_char *mp; u_char eebuf[128]; - int i; + int i = 8; bd_t *bd; bd = *bdp; @@ -63,11 +63,21 @@ /* All we are looking for is the Ethernet MAC address. The * first 8 bytes are 'MOTOROLA', so check for part of that. + * Next, the VPD describes a MAC 'packet' as being of type 08 + * and size 06. So we look for that and the MAC must follow. + * If there are more than one, we still only care about the first. * If it's there, assume we have a valid MAC address. If not, * grab our default one. */ - if ((*(uint *)eebuf) == 0x4d4f544f) - mp = &eebuf[0x4c]; + if ((*(uint *)eebuf) == 0x4d4f544f) { + while (i < 127 && !(eebuf[i] == 0x08 && eebuf[i + 1] == 0x06)) + i += eebuf[i + 1] + 2; /* skip this packet */ + + if (i == 127) /* Couldn't find. */ + mp = (u_char *)def_enet_addr; + else + mp = &eebuf[i + 2]; + } else mp = (u_char *)def_enet_addr; |