]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
MdeModulePkg: IP4 should re-initiate a DHCP if it detects network reconnection
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Driver.c
index 101390cdf85270d5d733f34ca819ac8e83458e81..4d3ccec61047c9b1ddde686a43e21ac2b38401c9 100644 (file)
@@ -210,6 +210,10 @@ Ip4CreateService (
 \r
   IpSb->Timer = NULL;\r
 \r
+  IpSb->ReconfigEvent = NULL;\r
+  \r
+  IpSb->MediaPresent = TRUE;\r
+\r
   //\r
   // Create various resources. First create the route table, timer\r
   // event and MNP child. IGMP, interface's initialization depend\r
@@ -386,6 +390,12 @@ Ip4CleanService (
     IpSb->Timer = NULL;\r
   }\r
 \r
+  if (IpSb->ReconfigEvent != NULL) {\r
+    gBS->CloseEvent (IpSb->ReconfigEvent);\r
+\r
+    IpSb->ReconfigEvent = NULL;\r
+  }\r
+\r
   if (IpSb->MacString != NULL) {\r
     FreePool (IpSb->MacString);\r
   }\r