From 779ae3579848a36319d67a6ba012b4b9aa88aa6b Mon Sep 17 00:00:00 2001 From: xdu2 Date: Wed, 30 Dec 2009 13:47:55 +0000 Subject: Add VLAN support. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9649 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MdeModulePkg/Universal/Network/Ip4Dxe') diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c index 1b7fa4e603..5e297821a2 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c @@ -291,6 +291,12 @@ Ip4CreateService ( InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link); IpSb->MaxPacketSize = IpSb->SnpMode.MaxPacketSize - sizeof (IP4_HEAD); + if (NetLibGetVlanId (IpSb->Controller) != 0) { + // + // This is a VLAN device, reduce MTU by VLAN tag length + // + IpSb->MaxPacketSize -= NET_VLAN_TAG_LEN; + } IpSb->MacString = NULL; *Service = IpSb; -- cgit v1.2.3