summaryrefslogtreecommitdiff
path: root/OptionRomPkg
diff options
context:
space:
mode:
authortye <tye@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-14 08:14:08 +0000
committertye <tye@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-14 08:14:08 +0000
commitcd4179255601b9dda32de906851f9c97fc7a8844 (patch)
treeaa46915a27e4c851fff6b20c3b27512aae9d7d12 /OptionRomPkg
parentc9ec70470dd666d15355d621cbed9b238c3090d0 (diff)
downloadedk2-platforms-cd4179255601b9dda32de906851f9c97fc7a8844.tar.xz
Enable Undi driver to support multicast MAC address mapped from IPv6 address
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9561 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OptionRomPkg')
-rw-r--r--OptionRomPkg/UndiRuntimeDxe/Decode.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/OptionRomPkg/UndiRuntimeDxe/Decode.c b/OptionRomPkg/UndiRuntimeDxe/Decode.c
index 670fa18d53..d2d4aba888 100644
--- a/OptionRomPkg/UndiRuntimeDxe/Decode.c
+++ b/OptionRomPkg/UndiRuntimeDxe/Decode.c
@@ -1,7 +1,7 @@
/** @file
Provides the basic UNID functions.
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -557,6 +557,8 @@ UNDI_RecFilter (
UINT16 copy_len;
UINT8 *ptr1;
UINT8 *ptr2;
+ BOOLEAN InvalidMacAddr;
+
OpFlags = CdbPtr->OpFlags;
NewFilter = (UINT16) (OpFlags & 0x1F);
@@ -609,8 +611,32 @@ UNDI_RecFilter (
MacAddr = (UINT8 *) ((UINTN) (CdbPtr->CPBaddr));
MacCount = CdbPtr->CPBsize / sizeof (PXE_MAC_ADDR);
+ //
+ // The format of Ethernet multicast address for IPv6 is defined in RFC2464,
+ // for IPv4 is defined in RFC1112. Check whether the address is valid.
+ //
+ InvalidMacAddr = FALSE;
+
for (; MacCount-- != 0; MacAddr += sizeof (PXE_MAC_ADDR)) {
- if (MacAddr[0] != 0x01 || MacAddr[1] != 0x00 || MacAddr[2] != 0x5E || (MacAddr[3] & 0x80) != 0) {
+ if (MacAddr[0] == 0x01) {
+ //
+ // This multicast MAC address is mapped from IPv4 address.
+ //
+ if (MacAddr[1] != 0x00 || MacAddr[2] != 0x5E || (MacAddr[3] & 0x80) != 0) {
+ InvalidMacAddr = TRUE;
+ }
+ } else if (MacAddr[0] == 0x33) {
+ //
+ // This multicast MAC address is mapped from IPv6 address.
+ //
+ if (MacAddr[1] != 0x33) {
+ InvalidMacAddr = TRUE;
+ }
+ } else {
+ InvalidMacAddr = TRUE;
+ }
+
+ if (InvalidMacAddr) {
CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;
CdbPtr->StatCode = PXE_STATCODE_INVALID_CPB;
return ;