From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g1t6220.austin.hp.com (g1t6220.austin.hp.com [15.73.96.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3A8541A1EE9 for ; Wed, 21 Sep 2016 23:42:07 -0700 (PDT) Received: from GARLI1.asiapacific.hpqcorp.net (garli1.asiapacific.hpqcorp.net [16.159.110.237]) by g1t6220.austin.hp.com (Postfix) with ESMTP id 0529B136; Thu, 22 Sep 2016 06:42:04 +0000 (UTC) From: Gary Li To: edk2-devel@lists.01.org Cc: siyuan.fu@intel.com, ting.ye@intel.com, jiaxin.wu@intel.com, sriram-s@hpe.com, garyli@hpe.com Date: Thu, 22 Sep 2016 14:38:18 +0800 Message-Id: <1474526298-10600-1-git-send-email-garyli@hpe.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [PATCH] NetworkPkg: Fix RSOD issue in Ip6Dxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 06:42:07 -0000 Avoid the Ip6NdFasterTimerTicking is executed again before the previous Ip6NdFasterTimerTicking is done. When user presses hotkey between the below line, it makes the Ip6NdFasterTimerTicking is dispatched again before the previous Ip6NdFasterTimerTicking is done. Therefore, the DelayNode node will be removed twice. DelayNode = NET_LIST_USER_STRUCT (Entry2, IP6_DELAY_JOIN_LIST, Link); ... RemoveEntryList (&DelayNode->Link); Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Li --- NetworkPkg/Ip6Dxe/Ip6Nd.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/NetworkPkg/Ip6Dxe/Ip6Nd.c b/NetworkPkg/Ip6Dxe/Ip6Nd.c index a3f49bb..d400d7c 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Nd.c +++ b/NetworkPkg/Ip6Dxe/Ip6Nd.c @@ -2,6 +2,7 @@ Implementation of Neighbor Discovery support routines. Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -16,6 +17,7 @@ #include "Ip6Impl.h" EFI_MAC_ADDRESS mZeroMacAddress; +BOOLEAN mIsInIp6NdFasterTimerTicking = FALSE; /** Update the ReachableTime in IP6 service binding instance data, in milliseconds. @@ -2774,6 +2776,12 @@ Ip6NdFasterTimerTicking ( IP6_SERVICE *IpSb; BOOLEAN Flag; + if (!mIsInIp6NdFasterTimerTicking) { + mIsInIp6NdFasterTimerTicking = TRUE; + } else { + return; + } + IpSb = (IP6_SERVICE *) Context; NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE); @@ -2848,7 +2856,7 @@ Ip6NdFasterTimerTicking ( NULL ); if (EFI_ERROR (Status)) { - return; + goto Exit; } DupAddrDetect->Transmit++; @@ -2896,7 +2904,7 @@ Ip6NdFasterTimerTicking ( Ip6CreateSNMulticastAddr (&NeighborCache->Neighbor, &Destination); Status = Ip6SelectSourceAddress (IpSb, &NeighborCache->Neighbor, &Source); if (EFI_ERROR (Status)) { - return; + goto Exit; } Status = Ip6SendNeighborSolicit ( @@ -2907,7 +2915,7 @@ Ip6NdFasterTimerTicking ( &IpSb->SnpMode.CurrentAddress ); if (EFI_ERROR (Status)) { - return; + goto Exit; } } @@ -2934,7 +2942,7 @@ Ip6NdFasterTimerTicking ( NULL ); if (EFI_ERROR (Status)) { - return; + goto Exit; } } @@ -2965,7 +2973,7 @@ Ip6NdFasterTimerTicking ( NULL ); if (EFI_ERROR (Status)) { - return; + goto Exit; } } else { NeighborCache->State = EfiNeighborStale; @@ -2986,7 +2994,7 @@ Ip6NdFasterTimerTicking ( // Status = Ip6SelectSourceAddress (IpSb, &NeighborCache->Neighbor, &Source); if (EFI_ERROR (Status)) { - return; + goto Exit; } Status = Ip6SendNeighborSolicit ( @@ -2997,7 +3005,7 @@ Ip6NdFasterTimerTicking ( &IpSb->SnpMode.CurrentAddress ); if (EFI_ERROR (Status)) { - return; + goto Exit; } NeighborCache->Transmit--; @@ -3023,7 +3031,7 @@ Ip6NdFasterTimerTicking ( // Status = Ip6SelectSourceAddress (IpSb, &NeighborCache->Neighbor, &Source); if (EFI_ERROR (Status)) { - return; + goto Exit; } Status = Ip6SendNeighborSolicit ( @@ -3034,7 +3042,7 @@ Ip6NdFasterTimerTicking ( &IpSb->SnpMode.CurrentAddress ); if (EFI_ERROR (Status)) { - return; + goto Exit; } } @@ -3061,7 +3069,7 @@ Ip6NdFasterTimerTicking ( NULL ); if (EFI_ERROR (Status)) { - return; + goto Exit; } } @@ -3071,6 +3079,9 @@ Ip6NdFasterTimerTicking ( break; } } + +Exit: + mIsInIp6NdFasterTimerTicking = FALSE; } /** -- 2.7.2.windows.1