audk/MdeModulePkg/Universal/Network/Ip4Dxe
Jiaxin Wu bd0656b5e2 MdeModulePkg: Fix potential failure if UseDefaultAddress configured
IpSb->Reconfig should not be set to TRUE to focal the reconfiguration
during the policy changes from Static to DHCP. It's redundancy because
the default router table and default addresses have been freed ahead (
Detailed see Ip4Config2OnPolicyChanged() function). Otherwise, the
potential failure will appear if UseDefaultAddress configured. Reproduce
steps see below:

#1. Set policy to DHCP.
#2. If DHCP process is not complete yet, then run one APP to invoke UDP4
Configure with "UseDefaultAddress = TRUE" (loop to call UDP4 Configure
until Ip4Mode.IsConfigured changes to TRUE).
#3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to TRUE

Concrete analysis is as follows:
In #1, the policy will be set to DHCP, and then Ip4Config2OnPolicyChanged()
will be called. In this function, if "IpSb->Reconfig" flag is set to TRUE,
the original "IpSb->DefaultInterface" will be abandoned/freed once the
DHCP process finished.

In #2, UDP4 Configure with "UseDefaultAddress = TRUE" is called, that means
the default interface (IpSb->DefaultInterface) will be selected as current
instance's interface.

In #3, when DHCP process finished, the original DefaultInterface will be
abandoned/freed because "IpSb->Reconfig" flag is true. Meanwhile, one new
interface is assigned to "IpSb->DefaultInterface". This new interface is
different to the original one assigned to the UDP4 Configured instance. So,
even DHCP process succeed, the up caller will never have the chance to get
it's truly status.

Cc: Cohen Eugene <eugene@hp.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Tested-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-08-18 13:54:50 +08:00
..
ComponentName.c 1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support. 2012-12-13 06:47:06 +00:00
Ip4Common.c 1. Mark the network volatile variables as deprecated in code comments and remove related code to set/get these variable. 2014-05-07 06:17:31 +00:00
Ip4Common.h 1. Mark the network volatile variables as deprecated in code comments and remove related code to set/get these variable. 2014-05-07 06:17:31 +00:00
Ip4Config2.vfr MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Config2Impl.c MdeModulePkg: Fix potential failure if UseDefaultAddress configured 2016-08-18 13:54:50 +08:00
Ip4Config2Impl.h MdeModulePkg: Fix IPv4 stack potential disappeared issue 2016-07-07 08:46:48 +08:00
Ip4Config2Nv.c MdeModulePkg: Code logic optimization for Ip4Dxe driver 2015-07-10 09:01:42 +00:00
Ip4Config2Nv.h MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Driver.c MdeModulePkg: Fix typos in comments and variables 2016-07-11 10:29:48 +08:00
Ip4Driver.h MdeModulePkg: Fix typos in comments and variables 2016-07-11 10:29:48 +08:00
Ip4Dxe.inf MdeModulePkg: Change the default IPv4 config policy 2016-03-02 15:43:50 +08:00
Ip4Dxe.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
Ip4DxeExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
Ip4DxeStrings.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
Ip4Icmp.c MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Icmp.h MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4If.c MdeModulePkg: Add new macros and refine codes 2016-04-11 08:25:33 +08:00
Ip4If.h MdeModulePkg: Fix typos in comments and variables 2016-07-11 10:29:48 +08:00
Ip4Igmp.c MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Igmp.h MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Impl.c MdeModulePkg: Fix IPv4 UseDefaultAddress failure case. 2016-06-08 15:17:31 +08:00
Ip4Impl.h MedmodulePkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration. 2016-06-23 09:39:23 +08:00
Ip4Input.c MdeModulePkg/NetworkPkg: Locate IpSec on IP packet processing only if it's installed. 2015-08-31 07:44:12 +00:00
Ip4Input.h 1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support. 2012-12-13 06:47:06 +00:00
Ip4NvData.h MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Option.c MdeModulePkg: Remove variables that are set, but not used 2011-10-31 15:58:05 +00:00
Ip4Option.h Update the copyright notice format 2010-04-24 09:33:45 +00:00
Ip4Output.c MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol, 2015-07-07 08:19:55 +00:00
Ip4Output.h Update the copyright notice format 2010-04-24 09:33:45 +00:00
Ip4Route.c MdeModulePkg: Add new macros and refine codes 2016-04-11 08:25:33 +08:00
Ip4Route.h Update the copyright notice format 2010-04-24 09:33:45 +00:00