summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-06-22 17:49:43 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-06-23 15:40:31 +0800
commit5cb90e14e15a4cbae5d35b75c2336e0001ef583a (patch)
tree9823d32f3b6f5238192828397b540765acd13db1
parentf5cbc197d4a9599fc955e5805b0e169fd054be11 (diff)
downloadedk2-platforms-5cb90e14e15a4cbae5d35b75c2336e0001ef583a.tar.xz
MdeModulePkg: Fix the wrong IpSb->State update
This patch is used to fix the wrong IpSb->State update issue. Issue reproduce steps: 1 .First PXE boot, then boot to shell; 2. ifconfig -s eth0 dhcp (Success); 3. Reboot and do PXE, then boot to shell; 4. ifconfig -s eth0 dhcp (Platform failed to get IP address no matter how many times retried.) Root cause: On step3 reboot, policy is DHCP (Changed by step2). So, Ip4Dxe driver will try to get one IP address from DHCP server automatically. Before it get the IP address successfully, the IpSb->State will be always in IP4_SERVICE_STARTED status until the Instance->Dhcp4Event is triggered, then it can be changed to IP4_SERVICE_CONFIGED. But the DHCP process will be interrupted by PXE boot, which will change the policy to static, and the Instance->Dhcp4Event will be also closed directly. However, current implementation doesn't update the IpSb->State to IP4_SERVICE_UNSTARTED status in such case. So, failure happened. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 3dc171cbd3..028c61de06 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -142,7 +142,7 @@ Ip4Config2OnPolicyChanged (
IpSb->DefaultRouteTable = RouteTable;
Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
- if (IpSb->State == IP4_SERVICE_CONFIGED) {
+ if (IpSb->State == IP4_SERVICE_CONFIGED || IpSb->State == IP4_SERVICE_STARTED) {
IpSb->State = IP4_SERVICE_UNSTARTED;
}