mirror of https://github.com/acidanthera/audk.git
1. Fix timer unit bug in MNP: default rx/tx timeout value should be 10,000,000 (10s) according to UEFI spec.
2. Enable the mapping from IPv6 multicast address to MAC address in MnpMcastIpToMac(). 3. Remove 2 tabs. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9355 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c5bcc2e2ab
commit
87f89c0840
|
@ -32,8 +32,8 @@ EFI_MANAGED_NETWORK_PROTOCOL mMnpProtocolTemplate = {
|
|||
};
|
||||
|
||||
EFI_MANAGED_NETWORK_CONFIG_DATA mMnpDefaultConfigData = {
|
||||
10000,
|
||||
10000,
|
||||
10000000,
|
||||
10000000,
|
||||
0,
|
||||
FALSE,
|
||||
FALSE,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Implementation of Managed Network Protocol public services.
|
||||
|
||||
Copyright (c) 2005 - 2007, Intel Corporation. <BR>
|
||||
Copyright (c) 2005 - 2009, Intel Corporation. <BR>
|
||||
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
|
||||
|
@ -226,22 +226,20 @@ MnpMcastIpToMac (
|
|||
MNP_INSTANCE_DATA *Instance;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
EFI_TPL OldTpl;
|
||||
EFI_IPv6_ADDRESS *Ip6Address;
|
||||
|
||||
if ((This == NULL) || (IpAddress == NULL) || (MacAddress == NULL)) {
|
||||
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (Ipv6Flag) {
|
||||
//
|
||||
// Currently IPv6 isn't supported.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
Ip6Address = &IpAddress->v6;
|
||||
|
||||
if (!IP4_IS_MULTICAST (EFI_NTOHL (*IpAddress))) {
|
||||
if ((Ipv6Flag && !IP6_IS_MULTICAST (Ip6Address)) ||
|
||||
(!Ipv6Flag && !IP4_IS_MULTICAST (EFI_NTOHL (*IpAddress)))
|
||||
) {
|
||||
//
|
||||
// The IPv4 address passed in is not a multicast address.
|
||||
// The IP address passed in is not a multicast address.
|
||||
//
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
@ -259,10 +257,13 @@ MnpMcastIpToMac (
|
|||
Snp = Instance->MnpServiceData->Snp;
|
||||
ASSERT (Snp != NULL);
|
||||
|
||||
ZeroMem (MacAddress, sizeof (EFI_MAC_ADDRESS));
|
||||
|
||||
if (Snp->Mode->IfType == NET_IFTYPE_ETHERNET) {
|
||||
if (!Ipv6Flag) {
|
||||
//
|
||||
// Translate the IPv4 address into a multicast MAC address if the NIC is an
|
||||
// ethernet NIC.
|
||||
// ethernet NIC according to RFC1112..
|
||||
//
|
||||
MacAddress->Addr[0] = 0x01;
|
||||
MacAddress->Addr[1] = 0x00;
|
||||
|
@ -270,6 +271,19 @@ MnpMcastIpToMac (
|
|||
MacAddress->Addr[3] = (UINT8) (IpAddress->v4.Addr[1] & 0x7F);
|
||||
MacAddress->Addr[4] = IpAddress->v4.Addr[2];
|
||||
MacAddress->Addr[5] = IpAddress->v4.Addr[3];
|
||||
} else {
|
||||
//
|
||||
// Translate the IPv6 address into a multicast MAC address if the NIC is an
|
||||
// ethernet NIC according to RFC2464.
|
||||
//
|
||||
|
||||
MacAddress->Addr[0] = 0x33;
|
||||
MacAddress->Addr[1] = 0x33;
|
||||
MacAddress->Addr[2] = Ip6Address->Addr[12];
|
||||
MacAddress->Addr[3] = Ip6Address->Addr[13];
|
||||
MacAddress->Addr[4] = Ip6Address->Addr[14];
|
||||
MacAddress->Addr[5] = Ip6Address->Addr[15];
|
||||
}
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue