- Variable = Ip4ConfigReadVariable ();\r
-\r
- if (Variable == NULL) {\r
- return EFI_SUCCESS;\r
- }\r
-\r
- NicConfig = Ip4ConfigFindNicVariable (Variable, &Instance->NicAddr);\r
-\r
- if (NicConfig == NULL) {\r
- goto ON_EXIT;\r
- }\r
-\r
- //\r
- // Don't modify the permant static configuration\r
- //\r
- if (NicConfig->Perment && (NicConfig->Source == IP4_CONFIG_SOURCE_STATIC)) {\r
- goto ON_EXIT;\r
- }\r
-\r
- //\r
- // Delete the non-permant configuration and remove the previous\r
- // acquired DHCP parameters. Only doing DHCP itself is permant\r
- //\r
- NewVariable = NULL;\r
-\r
- if (!NicConfig->Perment) {\r
- NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NULL);\r
-\r
- } else if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {\r
- ZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));\r
- NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NicConfig);\r
-\r
- }\r
-\r
- Ip4ConfigWriteVariable (NewVariable);\r
-\r
- if (NewVariable != NULL) {\r
- gBS->FreePool (NewVariable);\r
- }\r
-\r
-ON_EXIT:\r
- gBS->FreePool (Variable);\r
-\r