]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IpSecDxe/Ikev2/Exchange.c
NetworkPkg: Fix hang issue after system reconnected when IPSec has set up
[mirror_edk2.git] / NetworkPkg / IpSecDxe / Ikev2 / Exchange.c
index 7634d11a2a89a8b29794a343aed1d0b98a85f1ce..9d58ab0a46f6b46bb2f58fb3e257a19d042e07a5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The general interfaces of the IKEv2.\r
 \r
-  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -330,7 +330,7 @@ Ikev2NegotiateInfo (
     //\r
     // Send out the Packet\r
     //\r
-    if (UdpService != NULL) {\r
+    if (UdpService != NULL && UdpService->Output != NULL) {\r
       Status = Ikev2SendIkePacket (UdpService, (UINT8 *) SaCommon, IkePacket, 0);\r
 \r
       if (EFI_ERROR (Status)) {\r
@@ -357,7 +357,7 @@ Ikev2NegotiateInfo (
       //\r
       // Send out the Packet\r
       //\r
-      if (UdpService != NULL) {\r
+      if (UdpService != NULL && UdpService->Output != NULL) {\r
         Status = Ikev2SendIkePacket (UdpService, (UINT8 *) &ChildSaSession->SessionCommon, IkePacket, 0);\r
 \r
         if (EFI_ERROR (Status)) {\r
@@ -779,11 +779,11 @@ Ikev2HandleInfo (
   }\r
 }\r
 \r
-IKE_EXCHANGE_INTERFACE  mIkev1Exchange = {
-  1,
+IKE_EXCHANGE_INTERFACE  mIkev1Exchange = {\r
+  1,\r
   NULL, //Ikev1NegotiateSa\r
   NULL, //Ikev1NegotiateChildSa\r
-  NULL,
+  NULL,\r
   NULL, //Ikev1HandleSa,\r
   NULL, //Ikev1HandleChildSa\r
   NULL, //Ikev1HandleInfo\r