From 8ff272ee837ebdfba6b72ed3dcf5e7ab136d8af0 Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Mon, 6 Jan 2014 02:17:12 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9Creconnect=20-r=E2=80=9D=20ASSERT?= =?UTF-8?q?=20after=20VLAN=20configured.=20Signed-off-by:=20Fu=20Siyuan=20?= =?UTF-8?q?=20Reviewed-by:=20Zhang,=20Chao=20B=20=20Reviewed-by:=20Jin,=20Eric=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15048 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c index b8f61bf696..7f03b848ef 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c @@ -1,7 +1,7 @@ /** @file Implementation of Managed Network Protocol I/O functions. -Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2014, 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 @@ -128,16 +128,13 @@ MnpBuildTxPacket ( MNP_DEVICE_DATA *MnpDerviceData; MnpDerviceData = MnpServiceData->MnpDeviceData; + + // + // Reserve space for vlan tag. + // + *PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN; + 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; - } - CopyMem ( *PktBuf, TxData->FragmentTable[0].FragmentBuffer, @@ -151,9 +148,8 @@ MnpBuildTxPacket ( // one fragment, copy the data into the packet buffer. Reserve the // media header space if necessary. // - SnpMode = MnpDerviceData->Snp->Mode; - DstPos = MnpDerviceData->TxBuf; - + SnpMode = MnpDerviceData->Snp->Mode; + DstPos = *PktBuf; *PktLen = 0; 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; } }