mirror of https://github.com/acidanthera/audk.git
Fix “reconnect -r” ASSERT after VLAN configured.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Jin, Eric <eric.jin@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15048 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ecec420440
commit
8ff272ee83
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Implementation of Managed Network Protocol I/O functions.
|
Implementation of Managed Network Protocol I/O functions.
|
||||||
|
|
||||||
Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
are licensed and made available under the terms and conditions
|
||||||
of the BSD License which accompanies this distribution. The full
|
of the BSD License which accompanies this distribution. The full
|
||||||
|
@ -128,16 +128,13 @@ MnpBuildTxPacket (
|
||||||
MNP_DEVICE_DATA *MnpDerviceData;
|
MNP_DEVICE_DATA *MnpDerviceData;
|
||||||
|
|
||||||
MnpDerviceData = MnpServiceData->MnpDeviceData;
|
MnpDerviceData = MnpServiceData->MnpDeviceData;
|
||||||
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {
|
|
||||||
//
|
|
||||||
// Reserve space for vlan tag,if necessary.
|
|
||||||
//
|
|
||||||
if (MnpServiceData->VlanId != 0) {
|
|
||||||
*PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;
|
|
||||||
} else {
|
|
||||||
*PktBuf = MnpDerviceData->TxBuf;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Reserve space for vlan tag.
|
||||||
|
//
|
||||||
|
*PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;
|
||||||
|
|
||||||
|
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {
|
||||||
CopyMem (
|
CopyMem (
|
||||||
*PktBuf,
|
*PktBuf,
|
||||||
TxData->FragmentTable[0].FragmentBuffer,
|
TxData->FragmentTable[0].FragmentBuffer,
|
||||||
|
@ -152,8 +149,7 @@ MnpBuildTxPacket (
|
||||||
// media header space if necessary.
|
// media header space if necessary.
|
||||||
//
|
//
|
||||||
SnpMode = MnpDerviceData->Snp->Mode;
|
SnpMode = MnpDerviceData->Snp->Mode;
|
||||||
DstPos = MnpDerviceData->TxBuf;
|
DstPos = *PktBuf;
|
||||||
|
|
||||||
*PktLen = 0;
|
*PktLen = 0;
|
||||||
if (TxData->DestinationAddress != NULL) {
|
if (TxData->DestinationAddress != NULL) {
|
||||||
//
|
//
|
||||||
|
@ -177,9 +173,8 @@ MnpBuildTxPacket (
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set the buffer pointer and the buffer length.
|
// Set the buffer length.
|
||||||
//
|
//
|
||||||
*PktBuf = MnpDerviceData->TxBuf;
|
|
||||||
*PktLen += TxData->DataLength + TxData->HeaderLength;
|
*PktLen += TxData->DataLength + TxData->HeaderLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue