/** @file\r
Implementation of Neighbor Discovery support routines.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, 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
LIST_ENTRY *Entry;\r
IP6_PREFIX_LIST_ENTRY *TmpPrefixEntry;\r
\r
- if (Prefix == NULL || PreferredLifetime > ValidLifetime || PrefixLength >= IP6_PREFIX_NUM) {\r
+ if (Prefix == NULL || PreferredLifetime > ValidLifetime || PrefixLength > IP6_PREFIX_MAX) {\r
return NULL;\r
}\r
\r
// with DNS SERVERS.\r
//\r
Oro = (EFI_DHCP6_PACKET_OPTION *) OptBuf;\r
- Oro->OpCode = HTONS (IP6_CONFIG_DHCP6_OPTION_ORO);\r
+ Oro->OpCode = HTONS (DHCP6_OPT_ORO);\r
Oro->OpLen = HTONS (2);\r
- *((UINT16 *) &Oro->Data[0]) = HTONS (IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS);\r
+ *((UINT16 *) &Oro->Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS);\r
\r
InfoReqReXmit.Irt = 4;\r
InfoReqReXmit.Mrc = 64;\r
NET_CHECK_SIGNATURE (IpIf, IP6_INTERFACE_SIGNATURE);\r
ASSERT (AddressInfo != NULL);\r
\r
+ //\r
+ // Do nothing if we have already started DAD on the address.\r
+ //\r
+ if (Ip6FindDADEntry (IpIf->Service, &AddressInfo->Address, NULL) != NULL) {\r
+ return EFI_SUCCESS;\r
+ }\r
+ \r
Status = EFI_SUCCESS;\r
IpSb = IpIf->Service;\r
DadXmits = &IpSb->Ip6ConfigInstance.DadXmits;\r
if (IsDAD && !IsMaintained) {\r
DupAddrDetect = Ip6FindDADEntry (IpSb, &Target, &IpIf);\r
if (DupAddrDetect != NULL) {\r
- if (DupAddrDetect->Transmit == 0) {\r
- //\r
- // The NS is from another node to performing DAD on the same address since\r
- // we haven't send out any NS yet. Fail DAD for the tentative address.\r
- //\r
- Ip6OnDADFinished (FALSE, IpIf, DupAddrDetect);\r
- Status = EFI_ICMP_ERROR;\r
- goto Exit;\r
- }\r
-\r
//\r
// Check the MAC address of the incoming packet.\r
//\r
//\r
Flag = FALSE;\r
if ((DupAddrDetect->Receive == 0) ||\r
- (DupAddrDetect->Transmit == DupAddrDetect->Receive)) {\r
+ (DupAddrDetect->Transmit <= DupAddrDetect->Receive)) {\r
Flag = TRUE;\r
}\r
\r