IP4_ADDR Ip;\r
IP4_ADDR Netmask;\r
EFI_ARP_PROTOCOL *Arp;\r
+ EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;\r
+ EFI_IP4_CONFIG2_POLICY Policy;\r
\r
IpSb = IpInstance->Service;\r
\r
+ Ip4Config2 = NULL;\r
+\r
//\r
// User is changing packet filters. It must be stopped\r
// before the station address can be changed.\r
// Use the default address. Check the state.\r
//\r
if (IpSb->State == IP4_SERVICE_UNSTARTED) {\r
- Status = Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);\r
-\r
- if (EFI_ERROR (Status)) {\r
- goto ON_ERROR;\r
+ //\r
+ // Trigger the EFI_IP4_CONFIG2_PROTOCOL to retrieve the \r
+ // default IPv4 address if it is not available yet.\r
+ //\r
+ Policy = IpSb->Ip4Config2Instance.Policy;\r
+ if (Policy != Ip4Config2PolicyDhcp) {\r
+ Ip4Config2 = &IpSb->Ip4Config2Instance.Ip4Config2;\r
+ Policy = Ip4Config2PolicyDhcp;\r
+ Status= Ip4Config2->SetData (\r
+ Ip4Config2,\r
+ Ip4Config2DataTypePolicy,\r
+ sizeof (EFI_IP4_CONFIG2_POLICY),\r
+ &Policy\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto ON_ERROR;\r
+ }\r
}\r
}\r
\r