Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3492 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -139,7 +139,7 @@ MnpAddFreeNbuf (
|
||||
|
||||
for (Index = 0; Index < Count; Index++) {
|
||||
|
||||
Nbuf = NetbufAlloc (MnpServiceData->BufferLength);
|
||||
Nbuf = NetbufAlloc (MnpServiceData->BufferLength + MnpServiceData->PaddingSize);
|
||||
if (Nbuf == NULL) {
|
||||
|
||||
MNP_DEBUG_ERROR (("MnpAddFreeNbuf: NetBufAlloc failed.\n"));
|
||||
@ -147,6 +147,14 @@ MnpAddFreeNbuf (
|
||||
break;
|
||||
}
|
||||
|
||||
if (MnpServiceData->PaddingSize > 0) {
|
||||
//
|
||||
// Pad padding bytes before the media header
|
||||
//
|
||||
NetbufAllocSpace (Nbuf, MnpServiceData->PaddingSize, NET_BUF_TAIL);
|
||||
NetbufTrim (Nbuf, MnpServiceData->PaddingSize, NET_BUF_HEAD);
|
||||
}
|
||||
|
||||
NetbufQueAppend (&MnpServiceData->FreeNbufQue, Nbuf);
|
||||
}
|
||||
|
||||
@ -328,6 +336,12 @@ MnpInitializeServiceData (
|
||||
//
|
||||
MnpServiceData->BufferLength = MnpServiceData->Mtu + SnpMode->MediaHeaderSize + NET_ETHER_FCS_SIZE;
|
||||
|
||||
//
|
||||
// Make sure the protocol headers immediately following the media header
|
||||
// 4-byte aligned
|
||||
//
|
||||
MnpServiceData->PaddingSize = (4 - SnpMode->MediaHeaderSize) & 0x3;
|
||||
|
||||
//
|
||||
// Initialize the FreeNetBufQue and pre-allocate some NET_BUFs.
|
||||
//
|
||||
|
Reference in New Issue
Block a user