From 48bd653033b44046ff022047f2bb153adf080dea Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Sun, 26 Jul 2015 08:03:20 +0000 Subject: MdeModulePkg: Remove TransmitReceive() and ActiveChild dependency Fix git 59a8cfd4 (SVN r17869) removes DHCP4.TransmitReceive()and DORA process dependency, but it updated TransmitReceive() to take the ownership of DhcpSb->ActiveChild but never release it. This will break the retransmit and lease time out counter of DORA. To fix that, TransmitReceive() doesn't need to be the ActiveChild, and the timer routine should be updated to handle the TransmitReceive specially. Cc: Fu Siyuan Cc: Ye Ting Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting Signed-off-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18048 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 1 - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index 821dfbb450..4f491b4bba 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -1494,7 +1494,6 @@ EfiDhcp4TransmitReceive ( Instance = DHCP_INSTANCE_FROM_THIS (This); DhcpSb = Instance->Service; - DhcpSb->ActiveChild = Instance; if (Instance->Token != NULL) { // diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c index 995bbcf840..4bc991557a 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c @@ -1518,6 +1518,8 @@ DhcpOnTimerTick ( IN VOID *Context ) { + LIST_ENTRY *Entry; + LIST_ENTRY *Next; DHCP_SERVICE *DhcpSb; DHCP_PROTOCOL *Instance; EFI_STATUS Status; @@ -1665,10 +1667,17 @@ DhcpOnTimerTick ( } ON_EXIT: - if ((Instance != NULL) && (Instance->Token != NULL)) { - Instance->Timeout--; - if (Instance->Timeout == 0) { - PxeDhcpDone (Instance); + // + // Iterate through all the DhcpSb Children. + // + NET_LIST_FOR_EACH_SAFE (Entry, Next, &DhcpSb->Children) { + Instance = NET_LIST_USER_STRUCT (Entry, DHCP_PROTOCOL, Link); + + if ((Instance != NULL) && (Instance->Token != NULL)) { + Instance->Timeout--; + if (Instance->Timeout == 0) { + PxeDhcpDone (Instance); + } } } -- cgit v1.2.3