diff options
3 files changed, 37 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c index 0c5c6bce37..be006a8eb7 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2008, 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 text of the license may be found at
@@ -180,6 +180,7 @@ EfiNicIp4ConfigGetInfo ( } else {
Status = EFI_SUCCESS;
CopyMem (NicConfig, Config, Len);
+ Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);
}
*ConfigLen = Len;
@@ -272,6 +273,7 @@ EfiNicIp4ConfigSetInfo ( //
if (Reconfig && (Instance->ReconfigEvent != NULL)) {
Status = gBS->SignalEvent (Instance->ReconfigEvent);
+ NetLibDispatchDpc ();
}
return Status;
@@ -442,6 +444,8 @@ ON_ERROR: ON_EXIT:
gBS->RestoreTPL (OldTpl);
+ NetLibDispatchDpc ();
+
return Status;
}
@@ -555,6 +559,7 @@ EfiIp4ConfigGetData ( Status = EFI_BUFFER_TOO_SMALL;
} else {
CopyMem (ConfigData, &NicConfig->Ip4Info, Len);
+ Ip4ConfigFixRouteTablePointer (ConfigData);
}
*ConfigDataSize = Len;
@@ -676,6 +681,9 @@ Ip4ConfigOnDhcp4Complete ( ON_EXIT:
gBS->SignalEvent (Instance->DoneEvent);
Ip4ConfigCleanDhcp4 (Instance);
+
+ NetLibDispatchDpc ();
+
return ;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c index dabd13c1db..65c2f840aa 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2008, 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 text of the license may be found at
@@ -249,6 +249,7 @@ Ip4ConfigFindNicVariable ( }
CopyMem (Config, Cur, Len);
+ Ip4ConfigFixRouteTablePointer (&Config->Ip4Info);
return Config;
}
@@ -381,3 +382,20 @@ Ip4ConfigModifyVariable ( NewVar->CheckSum = (UINT16) (~NetblockChecksum ((UINT8 *) NewVar, TotalLen));
return NewVar;
}
+
+VOID
+Ip4ConfigFixRouteTablePointer (
+ IN EFI_IP4_IPCONFIG_DATA *ConfigData
+ )
+{
+ //
+ // The memory used for route table entries must immediately follow
+ // the ConfigData and be not packed.
+ //
+ if (ConfigData->RouteTableSize > 0) {
+ ConfigData->RouteTable = (EFI_IP4_ROUTE_TABLE *) (ConfigData + 1);
+ } else {
+ ConfigData->RouteTable = NULL;
+ }
+}
+
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h index 103072c61a..953f6edf96 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2008, 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 text of the license may be found at
@@ -32,11 +32,11 @@ Abstract: //
#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \
(sizeof (EFI_IP4_IPCONFIG_DATA) + \
- sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (Ip4Config)->RouteTableSize) - 1))
+ sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)
#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \
(sizeof (NIC_IP4_CONFIG_INFO) + \
- sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (NicConfig)->Ip4Info.RouteTableSize) - 1))
+ sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)
//
// Compare whether two NIC address are equal includes their type and length.
@@ -72,4 +72,10 @@ Ip4ConfigModifyVariable ( IN NIC_ADDR *NicAddr,
IN NIC_IP4_CONFIG_INFO *Config OPTIONAL
);
+
+VOID
+Ip4ConfigFixRouteTablePointer (
+ IN EFI_IP4_IPCONFIG_DATA *ConfigData
+ );
+
#endif
|