diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2015-08-11 11:07:17 +0000 |
---|---|---|
committer | jiaxinwu <jiaxinwu@Edk2> | 2015-08-11 11:07:17 +0000 |
commit | 3d0a49ad47619c30c84bbee8a33f54b64dddbcec (patch) | |
tree | f0f8dde9e91395117e4eff35471d450c6e1c860a /MdeModulePkg/Universal/Network/Ip4Dxe | |
parent | 00f6c6cf9fd7c802b67a1b38209a08c94e7e9616 (diff) | |
download | edk2-platforms-3d0a49ad47619c30c84bbee8a33f54b64dddbcec.tar.xz |
MdeModulePkg: Fix issue about current Ip4Dxe implementation for DHCP DORA process
DHCP policy is applied as default at boot time on all NICs in the system, which results
in all NIC ports attempting DHCP and trying to acquire IP addresses during boot.
Ip4 driver should only set dhcp as default policy, and not trigger DORA at driver binding
start(). We should start DORA until one IP child is configured to use default address.
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18201 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4Dxe')
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 21 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h | 16 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 7 |
3 files changed, 22 insertions, 22 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c index 2da4a51349..fcb2bdd562 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c @@ -85,22 +85,6 @@ Ip4Config2DestroyDhcp4 ( }
/**
- Start the DHCP configuration for this IP service instance.
- It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the
- DHCP configuration.
-
- @param[in] Instance The IP4 config2 instance to configure.
-
- @retval EFI_SUCCESS The auto configuration is successfull started.
- @retval Others Failed to start auto configuration.
-
-**/
-EFI_STATUS
-Ip4StartAutoConfig (
- IN IP4_CONFIG2_INSTANCE *Instance
- );
-
-/**
Update the current policy to NewPolicy. During the transition
period, the default router list
and address list in all interfaces will be released.
@@ -992,10 +976,7 @@ Ip4Config2SetPolicy ( }
if (NewPolicy == Instance->Policy) {
- if (NewPolicy != Ip4Config2PolicyDhcp || Instance->DhcpSuccess) {
- return EFI_ABORTED;
- }
-
+ return EFI_ABORTED;
} else {
if (NewPolicy == Ip4Config2PolicyDhcp) {
//
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h index 26e16a2617..e74b9ae407 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.h @@ -211,6 +211,22 @@ typedef struct { #pragma pack()
/**
+ Start the DHCP configuration for this IP service instance.
+ It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the
+ DHCP configuration.
+
+ @param[in] Instance The IP4 config2 instance to configure.
+
+ @retval EFI_SUCCESS The auto configuration is successfull started.
+ @retval Others Failed to start auto configuration.
+
+**/
+EFI_STATUS
+Ip4StartAutoConfig (
+ IN IP4_CONFIG2_INSTANCE *Instance
+ );
+
+/**
Initialize an IP4_CONFIG2_INSTANCE.
@param[out] Instance The buffer of IP4_CONFIG2_INSTANCE to be initialized.
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index b0f597fc97..2fb4f4c1ca 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -678,8 +678,11 @@ Ip4ConfigProtocol ( // been started, start it.
//
if (IpSb->State == IP4_SERVICE_UNSTARTED) {
- Status = EFI_NO_MAPPING;
- goto ON_ERROR;
+ Status = Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);
+
+ if (EFI_ERROR (Status)) {
+ goto ON_ERROR;
+ }
}
IpIf = IpSb->DefaultInterface;
|