Changeset 77662 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe
- Timestamp:
- Mar 12, 2019 12:40:12 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129295
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776 /vendor/edk2/current 103735-103757,103769-103776,129194-129237
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/ComponentName.c
r58466 r77662 3 3 EFI_COMPONENT_NAME2_PROTOCOL protocol. 4 4 5 Copyright (c) 2009 - 201 2, Intel Corporation. All rights reserved.<BR>5 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 6 6 7 7 This program and the accompanying materials … … 264 264 Offset = 0; 265 265 Status = Ip6->GetModeData (Ip6, &Ip6ModeData, NULL, NULL); 266 if (!EFI_ERROR (Status)) { 267 if (Ip6ModeData.AddressList != NULL) { 268 FreePool (Ip6ModeData.AddressList); 269 } 270 271 if (Ip6ModeData.GroupTable != NULL) { 272 FreePool (Ip6ModeData.GroupTable); 273 } 274 275 if (Ip6ModeData.RouteTable != NULL) { 276 FreePool (Ip6ModeData.RouteTable); 277 } 278 279 if (Ip6ModeData.NeighborCache != NULL) { 280 FreePool (Ip6ModeData.NeighborCache); 281 } 282 283 if (Ip6ModeData.PrefixTable != NULL) { 284 FreePool (Ip6ModeData.PrefixTable); 285 } 286 287 if (Ip6ModeData.IcmpTypeList != NULL) { 288 FreePool (Ip6ModeData.IcmpTypeList); 289 } 290 } 291 266 292 if (!EFI_ERROR (Status) && Ip6ModeData.IsStarted) { 267 293 Status = NetLibIp6ToStr (&Ip6ModeData.ConfigData.StationAddress, Address, sizeof(Address)); -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Common.c
r58466 r77662 2 2 The implementation of common functions shared by IP6 driver. 3 3 4 Copyright (c) 2009 - 201 4, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 429 429 EFI_IPv6_ADDRESS SnMCastAddr; 430 430 431 if (IsListEmpty (AddressList) || *AddressCount < 1 || PrefixLength > IP6_PREFIX_ NUM) {431 if (IsListEmpty (AddressList) || *AddressCount < 1 || PrefixLength > IP6_PREFIX_MAX) { 432 432 return EFI_INVALID_PARAMETER; 433 433 } … … 607 607 608 608 ASSERT (Dest != NULL && Src != NULL); 609 ASSERT (PrefixLength < IP6_PREFIX_NUM);609 ASSERT (PrefixLength <= IP6_PREFIX_MAX); 610 610 611 611 Byte = (UINT8) (PrefixLength / 8); -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Config.vfr
r58466 r77662 22 22 title = STRING_TOKEN(STR_IP6_CONFIG_FORM_TITLE), 23 23 help = STRING_TOKEN(STR_IP6_CONFIG_FORM_HELP), 24 class = EFI_NETWORK_DEVICE_CLASS,25 subclass = 0x03,26 24 27 25 varstore IP6_CONFIG_IFR_NVDATA, -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c
r58459 r77662 2 2 The implementation of EFI IPv6 Configuration Protocol. 3 3 4 Copyright (c) 2009 - 201 3, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 48 48 ) 49 49 { 50 LIST_ENTRY *Entry; 51 LIST_ENTRY *Entry2; 52 LIST_ENTRY *Next; 53 IP6_INTERFACE *IpIf; 54 IP6_DAD_ENTRY *DadEntry; 50 LIST_ENTRY *Entry; 51 LIST_ENTRY *Entry2; 52 LIST_ENTRY *Next; 53 IP6_INTERFACE *IpIf; 54 IP6_DAD_ENTRY *DadEntry; 55 IP6_DELAY_JOIN_LIST *DelayNode; 56 IP6_ADDRESS_INFO *AddrInfo; 57 IP6_PROTOCOL *Instance; 58 BOOLEAN Recovery; 59 60 Recovery = FALSE; 55 61 56 62 // … … 80 86 } 81 87 82 // 83 // All IPv6 children that use global unicast address as it's source address 84 // should be destryoed now. The survivers are those use the link-local address 85 // or the unspecified address as the source address. 86 // TODO: Conduct a check here. 87 Ip6RemoveAddr ( 88 IpSb, 89 &IpSb->DefaultInterface->AddressList, 90 &IpSb->DefaultInterface->AddressCount, 91 NULL, 92 0 93 ); 88 if (!IsListEmpty (&IpSb->DefaultInterface->AddressList) && IpSb->DefaultInterface->AddressCount > 0) { 89 // 90 // If any IPv6 children (Instance) in configured state and use global unicast address, it will be 91 // destroyed in Ip6RemoveAddr() function later. Then, the upper layer driver's Stop() function will be 92 // called, which may break the upper layer network stacks. So, the driver should take the responsibility 93 // for the recovery by using ConnectController() after Ip6RemoveAddr(). 94 // Here, just check whether need to recover the upper layer network stacks later. 95 // 96 NET_LIST_FOR_EACH (Entry, &IpSb->DefaultInterface->AddressList) { 97 AddrInfo = NET_LIST_USER_STRUCT_S (Entry, IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE); 98 if (!IsListEmpty (&IpSb->Children)) { 99 NET_LIST_FOR_EACH (Entry2, &IpSb->Children) { 100 Instance = NET_LIST_USER_STRUCT_S (Entry2, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE); 101 if ((Instance->State == IP6_STATE_CONFIGED) && EFI_IP6_EQUAL (&Instance->ConfigData.StationAddress, &AddrInfo->Address)) { 102 Recovery = TRUE; 103 break; 104 } 105 } 106 } 107 } 108 109 // 110 // All IPv6 children that use global unicast address as it's source address 111 // should be destroyed now. The survivers are those use the link-local address 112 // or the unspecified address as the source address. 113 // TODO: Conduct a check here. 114 Ip6RemoveAddr ( 115 IpSb, 116 &IpSb->DefaultInterface->AddressList, 117 &IpSb->DefaultInterface->AddressCount, 118 NULL, 119 0 120 ); 121 122 if (IpSb->Controller != NULL && Recovery) { 123 // 124 // ConnectController() to recover the upper layer network stacks. 125 // 126 gBS->ConnectController (IpSb->Controller, NULL, NULL, TRUE); 127 } 128 } 129 94 130 95 131 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) { 96 132 // 97 // remove all pending DAD entries for the global addresses.133 // remove all pending delay node and DAD entries for the global addresses. 98 134 // 99 135 IpIf = NET_LIST_USER_STRUCT_S (Entry, IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE); 136 137 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DelayJoinList) { 138 DelayNode = NET_LIST_USER_STRUCT (Entry2, IP6_DELAY_JOIN_LIST, Link); 139 if (!NetIp6IsLinkLocalAddr (&DelayNode->AddressInfo->Address)) { 140 RemoveEntryList (&DelayNode->Link); 141 FreePool (DelayNode); 142 } 143 } 100 144 101 145 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DupAddrDetectList) { … … 113 157 if (NewPolicy == Ip6ConfigPolicyAutomatic) { 114 158 // 115 // Set param ters to trigger router solicitation sending in timer handler.159 // Set parameters to trigger router solicitation sending in timer handler. 116 160 // 117 161 IpSb->RouterAdvertiseReceived = FALSE; … … 122 166 IpSb->Ticks = (UINT32) IP6_GET_TICKS (IP6_ONE_SECOND_IN_MS); 123 167 } 124 125 168 } 126 169 … … 211 254 // 212 255 Oro = (EFI_DHCP6_PACKET_OPTION *) OptBuf; 213 Oro->OpCode = HTONS ( IP6_CONFIG_DHCP6_OPTION_ORO);256 Oro->OpCode = HTONS (DHCP6_OPT_ORO); 214 257 Oro->OpLen = HTONS (2); 215 *((UINT16 *) &Oro->Data[0]) = HTONS ( IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS);258 *((UINT16 *) &Oro->Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS); 216 259 OptList[0] = Oro; 217 260 … … 657 700 return EFI_ABORTED; 658 701 } else { 659 660 if (NewPolicy == Ip6ConfigPolicyAutomatic) { 661 // 662 // Clean the ManualAddress, Gateway and DnsServers, shrink the variable 663 // data size, and fire up all the related events. 664 // 665 DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; 666 if (DataItem->Data.Ptr != NULL) { 667 FreePool (DataItem->Data.Ptr); 668 } 669 DataItem->Data.Ptr = NULL; 670 DataItem->DataSize = 0; 671 DataItem->Status = EFI_NOT_FOUND; 672 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 673 674 DataItem = &Instance->DataItem[Ip6ConfigDataTypeGateway]; 675 if (DataItem->Data.Ptr != NULL) { 676 FreePool (DataItem->Data.Ptr); 677 } 678 DataItem->Data.Ptr = NULL; 679 DataItem->DataSize = 0; 680 DataItem->Status = EFI_NOT_FOUND; 681 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 682 683 DataItem = &Instance->DataItem[Ip6ConfigDataTypeDnsServer]; 684 DataItem->Data.Ptr = NULL; 685 DataItem->DataSize = 0; 686 DataItem->Status = EFI_NOT_FOUND; 687 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 688 } else { 702 // 703 // Clean the ManualAddress, Gateway and DnsServers, shrink the variable 704 // data size, and fire up all the related events. 705 // 706 DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; 707 if (DataItem->Data.Ptr != NULL) { 708 FreePool (DataItem->Data.Ptr); 709 } 710 DataItem->Data.Ptr = NULL; 711 DataItem->DataSize = 0; 712 DataItem->Status = EFI_NOT_FOUND; 713 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 714 715 DataItem = &Instance->DataItem[Ip6ConfigDataTypeGateway]; 716 if (DataItem->Data.Ptr != NULL) { 717 FreePool (DataItem->Data.Ptr); 718 } 719 DataItem->Data.Ptr = NULL; 720 DataItem->DataSize = 0; 721 DataItem->Status = EFI_NOT_FOUND; 722 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 723 724 DataItem = &Instance->DataItem[Ip6ConfigDataTypeDnsServer]; 725 DataItem->Data.Ptr = NULL; 726 DataItem->DataSize = 0; 727 DataItem->Status = EFI_NOT_FOUND; 728 NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL); 729 730 if (NewPolicy == Ip6ConfigPolicyManual) { 689 731 // 690 732 // The policy is changed from automatic to manual. Stop the DHCPv6 process … … 749 791 The callback function for Ip6SetAddr. The prototype is defined 750 792 as IP6_DAD_CALLBACK. It is called after Duplicate Address Detection is performed 751 for the manual address set by Ip6ConfigSetMa unualAddress.793 for the manual address set by Ip6ConfigSetManualAddress. 752 794 753 795 @param[in] IsDadPassed If TRUE, Duplicate Address Detection passed. … … 777 819 ManualAddr = NULL; 778 820 821 if (Item->DataSize == 0) { 822 return; 823 } 824 779 825 for (Index = 0; Index < Item->DataSize / sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); Index++) { 780 826 // … … 885 931 **/ 886 932 EFI_STATUS 887 Ip6ConfigSetMa unualAddress (933 Ip6ConfigSetManualAddress ( 888 934 IN IP6_CONFIG_INSTANCE *Instance, 889 935 IN UINTN DataSize, … … 908 954 EFI_STATUS Status; 909 955 BOOLEAN IsUpdated; 956 LIST_ENTRY *Next; 957 IP6_DAD_ENTRY *DadEntry; 958 IP6_DELAY_JOIN_LIST *DelayNode; 959 960 NewAddress = NULL; 961 TmpAddress = NULL; 962 CurrentAddrInfo = NULL; 963 Copy = NULL; 964 Entry = NULL; 965 Entry2 = NULL; 966 IpIf = NULL; 967 PrefixEntry = NULL; 968 Next = NULL; 969 DadEntry = NULL; 970 DelayNode = NULL; 971 Status = EFI_SUCCESS; 910 972 911 973 ASSERT (Instance->DataItem[Ip6ConfigDataTypeManualAddress].Status != EFI_NOT_READY); 912 974 913 if (( (DataSize % sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS)) != 0) || (DataSize == 0)) {975 if ((DataSize != 0) && ((DataSize % sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS)) != 0)) { 914 976 return EFI_BAD_BUFFER_SIZE; 915 977 } … … 919 981 } 920 982 921 NewAddressCount = DataSize / sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); 922 NewAddress = (EFI_IP6_CONFIG_MANUAL_ADDRESS *) Data; 923 924 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) { 925 926 if (NetIp6IsLinkLocalAddr (&NewAddress->Address) || 927 !NetIp6IsValidUnicast (&NewAddress->Address) || 928 (NewAddress->PrefixLength > 128) 929 ) { 930 // 931 // make sure the IPv6 address is unicast and not link-local address && 932 // the prefix length is valid. 933 // 934 return EFI_INVALID_PARAMETER; 935 } 936 937 TmpAddress = NewAddress + 1; 938 for (Index2 = Index1 + 1; Index2 < NewAddressCount; Index2++, TmpAddress++) { 939 // 940 // Any two addresses in the array can't be equal. 941 // 942 if (EFI_IP6_EQUAL (&TmpAddress->Address, &NewAddress->Address)) { 943 983 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance); 984 985 DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; 986 987 if (Data != NULL && DataSize != 0) { 988 NewAddressCount = DataSize / sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); 989 NewAddress = (EFI_IP6_CONFIG_MANUAL_ADDRESS *) Data; 990 991 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) { 992 993 if (NetIp6IsLinkLocalAddr (&NewAddress->Address) || 994 !NetIp6IsValidUnicast (&NewAddress->Address) || 995 (NewAddress->PrefixLength > 128) 996 ) { 997 // 998 // make sure the IPv6 address is unicast and not link-local address && 999 // the prefix length is valid. 1000 // 944 1001 return EFI_INVALID_PARAMETER; 945 1002 } 946 } 947 } 948 949 IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance); 950 951 // 952 // Build the current source address list. 953 // 954 InitializeListHead (&CurrentSourceList); 955 CurrentSourceCount = 0; 956 957 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) { 958 IpIf = NET_LIST_USER_STRUCT_S (Entry, IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE); 959 960 NET_LIST_FOR_EACH (Entry2, &IpIf->AddressList) { 961 CurrentAddrInfo = NET_LIST_USER_STRUCT_S (Entry2, IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE); 962 963 Copy = AllocateCopyPool (sizeof (IP6_ADDRESS_INFO), CurrentAddrInfo); 964 if (Copy == NULL) { 965 break; 966 } 967 968 InsertTailList (&CurrentSourceList, &Copy->Link); 969 CurrentSourceCount++; 970 } 971 } 972 973 // 974 // Update the value... a long journey starts 975 // 976 NewAddress = AllocateCopyPool (DataSize, Data); 977 if (NewAddress == NULL) { 978 Ip6RemoveAddr (NULL, &CurrentSourceList, &CurrentSourceCount, NULL, 0); 979 980 return EFI_OUT_OF_RESOURCES; 981 } 982 983 // 984 // Store the new data, and init the DataItem status to EFI_NOT_READY because 985 // we may have an asynchronous configuration process. 986 // 987 DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; 988 if (DataItem->Data.Ptr != NULL) { 989 FreePool (DataItem->Data.Ptr); 990 } 991 DataItem->Data.Ptr = NewAddress; 992 DataItem->DataSize = DataSize; 993 DataItem->Status = EFI_NOT_READY; 994 995 // 996 // Trigger DAD, it's an asynchronous process. 997 // 998 IsUpdated = FALSE; 999 1000 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) { 1001 if (Ip6IsOneOfSetAddress (IpSb, &NewAddress->Address, NULL, &CurrentAddrInfo)) { 1002 ASSERT (CurrentAddrInfo != NULL); 1003 // 1004 // Remove this already existing source address from the CurrentSourceList 1005 // built before. 1003 1004 TmpAddress = NewAddress + 1; 1005 for (Index2 = Index1 + 1; Index2 < NewAddressCount; Index2++, TmpAddress++) { 1006 // 1007 // Any two addresses in the array can't be equal. 1008 // 1009 if (EFI_IP6_EQUAL (&TmpAddress->Address, &NewAddress->Address)) { 1010 1011 return EFI_INVALID_PARAMETER; 1012 } 1013 } 1014 } 1015 1016 // 1017 // Build the current source address list. 1018 // 1019 InitializeListHead (&CurrentSourceList); 1020 CurrentSourceCount = 0; 1021 1022 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) { 1023 IpIf = NET_LIST_USER_STRUCT_S (Entry, IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE); 1024 1025 NET_LIST_FOR_EACH (Entry2, &IpIf->AddressList) { 1026 CurrentAddrInfo = NET_LIST_USER_STRUCT_S (Entry2, IP6_ADDRESS_INFO, Link, IP6_ADDR_INFO_SIGNATURE); 1027 1028 Copy = AllocateCopyPool (sizeof (IP6_ADDRESS_INFO), CurrentAddrInfo); 1029 if (Copy == NULL) { 1030 break; 1031 } 1032 1033 InsertTailList (&CurrentSourceList, &Copy->Link); 1034 CurrentSourceCount++; 1035 } 1036 } 1037 1038 // 1039 // Update the value... a long journey starts 1040 // 1041 NewAddress = AllocateCopyPool (DataSize, Data); 1042 if (NewAddress == NULL) { 1043 Ip6RemoveAddr (NULL, &CurrentSourceList, &CurrentSourceCount, NULL, 0); 1044 1045 return EFI_OUT_OF_RESOURCES; 1046 } 1047 1048 // 1049 // Store the new data, and init the DataItem status to EFI_NOT_READY because 1050 // we may have an asynchronous configuration process. 1051 // 1052 if (DataItem->Data.Ptr != NULL) { 1053 FreePool (DataItem->Data.Ptr); 1054 } 1055 DataItem->Data.Ptr = NewAddress; 1056 DataItem->DataSize = DataSize; 1057 DataItem->Status = EFI_NOT_READY; 1058 1059 // 1060 // Trigger DAD, it's an asynchronous process. 1061 // 1062 IsUpdated = FALSE; 1063 1064 for (Index1 = 0; Index1 < NewAddressCount; Index1++, NewAddress++) { 1065 if (Ip6IsOneOfSetAddress (IpSb, &NewAddress->Address, NULL, &CurrentAddrInfo)) { 1066 ASSERT (CurrentAddrInfo != NULL); 1067 // 1068 // Remove this already existing source address from the CurrentSourceList 1069 // built before. 1070 // 1071 Ip6RemoveAddr ( 1072 NULL, 1073 &CurrentSourceList, 1074 &CurrentSourceCount, 1075 &CurrentAddrInfo->Address, 1076 128 1077 ); 1078 1079 // 1080 // If the new address's prefix length is not specified, just use the previous configured 1081 // prefix length for this address. 1082 // 1083 if (NewAddress->PrefixLength == 0) { 1084 NewAddress->PrefixLength = CurrentAddrInfo->PrefixLength; 1085 } 1086 1087 // 1088 // This manual address is already in use, see whether prefix length is changed. 1089 // 1090 if (NewAddress->PrefixLength != CurrentAddrInfo->PrefixLength) { 1091 // 1092 // Remove the on-link prefix table, the route entry will be removed 1093 // implicitly. 1094 // 1095 PrefixEntry = Ip6FindPrefixListEntry ( 1096 IpSb, 1097 TRUE, 1098 CurrentAddrInfo->PrefixLength, 1099 &CurrentAddrInfo->Address 1100 ); 1101 if (PrefixEntry != NULL) { 1102 Ip6DestroyPrefixListEntry (IpSb, PrefixEntry, TRUE, FALSE); 1103 } 1104 1105 // 1106 // Save the prefix length. 1107 // 1108 CurrentAddrInfo->PrefixLength = NewAddress->PrefixLength; 1109 IsUpdated = TRUE; 1110 } 1111 1112 // 1113 // create a new on-link prefix entry. 1114 // 1115 PrefixEntry = Ip6FindPrefixListEntry ( 1116 IpSb, 1117 TRUE, 1118 NewAddress->PrefixLength, 1119 &NewAddress->Address 1120 ); 1121 if (PrefixEntry == NULL) { 1122 Ip6CreatePrefixListEntry ( 1123 IpSb, 1124 TRUE, 1125 (UINT32) IP6_INFINIT_LIFETIME, 1126 (UINT32) IP6_INFINIT_LIFETIME, 1127 NewAddress->PrefixLength, 1128 &NewAddress->Address 1129 ); 1130 } 1131 1132 CurrentAddrInfo->IsAnycast = NewAddress->IsAnycast; 1133 // 1134 // Artificially mark this address passed DAD be'coz it is already in use. 1135 // 1136 Ip6ManualAddrDadCallback (TRUE, &NewAddress->Address, Instance); 1137 } else { 1138 // 1139 // A new address. 1140 // 1141 IsUpdated = TRUE; 1142 1143 // 1144 // Set the new address, this will trigger DAD and activate the address if 1145 // DAD succeeds. 1146 // 1147 Ip6SetAddress ( 1148 IpSb->DefaultInterface, 1149 &NewAddress->Address, 1150 NewAddress->IsAnycast, 1151 NewAddress->PrefixLength, 1152 (UINT32) IP6_INFINIT_LIFETIME, 1153 (UINT32) IP6_INFINIT_LIFETIME, 1154 Ip6ManualAddrDadCallback, 1155 Instance 1156 ); 1157 } 1158 } 1159 1160 // 1161 // Check the CurrentSourceList, it now contains those addresses currently in 1162 // use and will be removed. 1163 // 1164 IpIf = IpSb->DefaultInterface; 1165 1166 while (!IsListEmpty (&CurrentSourceList)) { 1167 IsUpdated = TRUE; 1168 1169 CurrentAddrInfo = NET_LIST_HEAD (&CurrentSourceList, IP6_ADDRESS_INFO, Link); 1170 1171 // 1172 // This local address is going to be removed, the IP instances that are 1173 // currently using it will be destroyed. 1006 1174 // 1007 1175 Ip6RemoveAddr ( 1008 NULL,1009 & CurrentSourceList,1010 & CurrentSourceCount,1176 IpSb, 1177 &IpIf->AddressList, 1178 &IpIf->AddressCount, 1011 1179 &CurrentAddrInfo->Address, 1012 1180 128 … … 1014 1182 1015 1183 // 1016 // This manual address is already in use, see whether prefix length is changed. 1017 // 1018 if (NewAddress->PrefixLength != CurrentAddrInfo->PrefixLength) { 1019 // 1020 // Remove the on-link prefix table, the route entry will be removed 1021 // implicitly. 1022 // 1023 PrefixEntry = Ip6FindPrefixListEntry ( 1024 IpSb, 1025 TRUE, 1026 CurrentAddrInfo->PrefixLength, 1027 &CurrentAddrInfo->Address 1028 ); 1029 if (PrefixEntry != NULL) { 1030 Ip6DestroyPrefixListEntry (IpSb, PrefixEntry, TRUE, FALSE); 1031 } 1032 1033 // 1034 // Save the prefix length. 1035 // 1036 CurrentAddrInfo->PrefixLength = NewAddress->PrefixLength; 1037 IsUpdated = TRUE; 1038 } 1039 1040 // 1041 // create a new on-link prefix entry. 1184 // Remove the on-link prefix table, the route entry will be removed 1185 // implicitly. 1042 1186 // 1043 1187 PrefixEntry = Ip6FindPrefixListEntry ( 1044 1188 IpSb, 1045 1189 TRUE, 1046 NewAddress->PrefixLength,1047 & NewAddress->Address1190 CurrentAddrInfo->PrefixLength, 1191 &CurrentAddrInfo->Address 1048 1192 ); 1049 if (PrefixEntry == NULL) { 1050 Ip6CreatePrefixListEntry ( 1051 IpSb, 1052 TRUE, 1053 (UINT32) IP6_INFINIT_LIFETIME, 1054 (UINT32) IP6_INFINIT_LIFETIME, 1055 NewAddress->PrefixLength, 1056 &NewAddress->Address 1057 ); 1058 } 1059 1060 CurrentAddrInfo->IsAnycast = NewAddress->IsAnycast; 1061 // 1062 // Artificially mark this address passed DAD be'coz it is already in use. 1063 // 1064 Ip6ManualAddrDadCallback (TRUE, &NewAddress->Address, Instance); 1193 if (PrefixEntry != NULL) { 1194 Ip6DestroyPrefixListEntry (IpSb, PrefixEntry, TRUE, FALSE); 1195 } 1196 1197 RemoveEntryList (&CurrentAddrInfo->Link); 1198 FreePool (CurrentAddrInfo); 1199 } 1200 1201 if (IsUpdated) { 1202 if (DataItem->Status == EFI_NOT_READY) { 1203 // 1204 // If DAD is disabled on this interface, the configuration process is 1205 // actually synchronous, and the data item's status will be changed to 1206 // the final status before we reach here, just check it. 1207 // 1208 Status = EFI_NOT_READY; 1209 } else { 1210 Status = EFI_SUCCESS; 1211 } 1065 1212 } else { 1066 1213 // 1067 // A new address. 1068 // 1069 IsUpdated = TRUE; 1070 1071 // 1072 // Set the new address, this will trigger DAD and activate the address if 1073 // DAD succeeds. 1074 // 1075 Ip6SetAddress ( 1076 IpSb->DefaultInterface, 1077 &NewAddress->Address, 1078 NewAddress->IsAnycast, 1079 NewAddress->PrefixLength, 1214 // No update is taken, reset the status to success and return EFI_ABORTED. 1215 // 1216 DataItem->Status = EFI_SUCCESS; 1217 Status = EFI_ABORTED; 1218 } 1219 } else { 1220 // 1221 // DataSize is 0 and Data is NULL, clean up the manual address. 1222 // 1223 if (DataItem->Data.Ptr != NULL) { 1224 FreePool (DataItem->Data.Ptr); 1225 } 1226 DataItem->Data.Ptr = NULL; 1227 DataItem->DataSize = 0; 1228 DataItem->Status = EFI_NOT_FOUND; 1229 1230 Ip6CleanDefaultRouterList (IpSb); 1231 Ip6CleanPrefixListTable (IpSb, &IpSb->OnlinkPrefix); 1232 Ip6CleanPrefixListTable (IpSb, &IpSb->AutonomousPrefix); 1233 Ip6CleanAssembleTable (&IpSb->Assemble); 1234 1235 if (IpSb->LinkLocalOk) { 1236 Ip6CreatePrefixListEntry ( 1237 IpSb, 1238 TRUE, 1080 1239 (UINT32) IP6_INFINIT_LIFETIME, 1081 1240 (UINT32) IP6_INFINIT_LIFETIME, 1082 I p6ManualAddrDadCallback,1083 Instance1241 IP6_LINK_LOCAL_PREFIX_LENGTH, 1242 &IpSb->LinkLocalAddr 1084 1243 ); 1085 1244 } 1086 } 1087 1088 // 1089 // Check the CurrentSourceList, it now contains those addresses currently in 1090 // use and will be removed. 1091 // 1092 IpIf = IpSb->DefaultInterface; 1093 1094 while (!IsListEmpty (&CurrentSourceList)) { 1095 IsUpdated = TRUE; 1096 1097 CurrentAddrInfo = NET_LIST_HEAD (&CurrentSourceList, IP6_ADDRESS_INFO, Link); 1098 1099 // 1100 // This local address is going to be removed, the IP instances that are 1101 // currently using it will be destroyed. 1102 // 1245 1103 1246 Ip6RemoveAddr ( 1104 1247 IpSb, 1105 &Ip If->AddressList,1106 &Ip If->AddressCount,1107 &CurrentAddrInfo->Address,1108 1281248 &IpSb->DefaultInterface->AddressList, 1249 &IpSb->DefaultInterface->AddressCount, 1250 NULL, 1251 0 1109 1252 ); 1110 1253 1111 // 1112 // Remove the on-link prefix table, the route entry will be removed 1113 // implicitly. 1114 // 1115 PrefixEntry = Ip6FindPrefixListEntry ( 1116 IpSb, 1117 TRUE, 1118 CurrentAddrInfo->PrefixLength, 1119 &CurrentAddrInfo->Address 1120 ); 1121 if (PrefixEntry != NULL) { 1122 Ip6DestroyPrefixListEntry (IpSb, PrefixEntry, TRUE, FALSE); 1123 } 1124 1125 RemoveEntryList (&CurrentAddrInfo->Link); 1126 FreePool (CurrentAddrInfo); 1127 } 1128 1129 if (IsUpdated) { 1130 if (DataItem->Status == EFI_NOT_READY) { 1131 // 1132 // If DAD is disabled on this interface, the configuration process is 1133 // actually synchronous, and the data item's status will be changed to 1134 // the final status before we reach here, just check it. 1135 // 1136 Status = EFI_NOT_READY; 1137 } else { 1138 Status = EFI_SUCCESS; 1139 } 1140 } else { 1141 // 1142 // No update is taken, reset the status to success and return EFI_ABORTED. 1143 // 1144 DataItem->Status = EFI_SUCCESS; 1145 Status = EFI_ABORTED; 1254 NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) { 1255 // 1256 // Remove all pending delay node and DAD entries for the global addresses. 1257 // 1258 IpIf = NET_LIST_USER_STRUCT_S (Entry, IP6_INTERFACE, Link, IP6_INTERFACE_SIGNATURE); 1259 1260 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DelayJoinList) { 1261 DelayNode = NET_LIST_USER_STRUCT (Entry2, IP6_DELAY_JOIN_LIST, Link); 1262 if (!NetIp6IsLinkLocalAddr (&DelayNode->AddressInfo->Address)) { 1263 RemoveEntryList (&DelayNode->Link); 1264 FreePool (DelayNode); 1265 } 1266 } 1267 1268 NET_LIST_FOR_EACH_SAFE (Entry2, Next, &IpIf->DupAddrDetectList) { 1269 DadEntry = NET_LIST_USER_STRUCT_S (Entry2, IP6_DAD_ENTRY, Link, IP6_DAD_ENTRY_SIGNATURE); 1270 1271 if (!NetIp6IsLinkLocalAddr (&DadEntry->AddressInfo->Address)) { 1272 // 1273 // Fail this DAD entry if the address is not link-local. 1274 // 1275 Ip6OnDADFinished (FALSE, IpIf, DadEntry); 1276 } 1277 } 1278 } 1146 1279 } 1147 1280 … … 1191 1324 VOID *Tmp; 1192 1325 1193 if ((DataSize % sizeof (EFI_IPv6_ADDRESS) != 0) || (DataSize == 0)) { 1326 OldGateway = NULL; 1327 NewGateway = NULL; 1328 Item = NULL; 1329 DefaultRouter = NULL; 1330 Tmp = NULL; 1331 OneRemoved = FALSE; 1332 OneAdded = FALSE; 1333 1334 if ((DataSize != 0) && (DataSize % sizeof (EFI_IPv6_ADDRESS) != 0)) { 1194 1335 return EFI_BAD_BUFFER_SIZE; 1195 1336 } … … 1197 1338 if (Instance->Policy != Ip6ConfigPolicyManual) { 1198 1339 return EFI_WRITE_PROTECTED; 1199 }1200 1201 NewGateway = (EFI_IPv6_ADDRESS *) Data;1202 NewGatewayCount = DataSize / sizeof (EFI_IPv6_ADDRESS);1203 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {1204 1205 if (!NetIp6IsValidUnicast (NewGateway + Index1)) {1206 1207 return EFI_INVALID_PARAMETER;1208 }1209 1210 for (Index2 = Index1 + 1; Index2 < NewGatewayCount; Index2++) {1211 if (EFI_IP6_EQUAL (NewGateway + Index1, NewGateway + Index2)) {1212 return EFI_INVALID_PARAMETER;1213 }1214 }1215 1340 } 1216 1341 … … 1219 1344 OldGateway = Item->Data.Gateway; 1220 1345 OldGatewayCount = Item->DataSize / sizeof (EFI_IPv6_ADDRESS); 1221 OneRemoved = FALSE; 1222 OneAdded = FALSE; 1223 1224 if (NewGatewayCount != OldGatewayCount) { 1225 Tmp = AllocatePool (DataSize); 1226 if (Tmp == NULL) { 1227 return EFI_OUT_OF_RESOURCES; 1346 1347 for (Index1 = 0; Index1 < OldGatewayCount; Index1++) { 1348 // 1349 // Remove this default router. 1350 // 1351 DefaultRouter = Ip6FindDefaultRouter (IpSb, OldGateway + Index1); 1352 if (DefaultRouter != NULL) { 1353 Ip6DestroyDefaultRouter (IpSb, DefaultRouter); 1354 OneRemoved = TRUE; 1355 } 1356 } 1357 1358 if (Data != NULL && DataSize != 0) { 1359 NewGateway = (EFI_IPv6_ADDRESS *) Data; 1360 NewGatewayCount = DataSize / sizeof (EFI_IPv6_ADDRESS); 1361 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) { 1362 1363 if (!NetIp6IsValidUnicast (NewGateway + Index1)) { 1364 1365 return EFI_INVALID_PARAMETER; 1366 } 1367 1368 for (Index2 = Index1 + 1; Index2 < NewGatewayCount; Index2++) { 1369 if (EFI_IP6_EQUAL (NewGateway + Index1, NewGateway + Index2)) { 1370 return EFI_INVALID_PARAMETER; 1371 } 1372 } 1373 } 1374 1375 if (NewGatewayCount != OldGatewayCount) { 1376 Tmp = AllocatePool (DataSize); 1377 if (Tmp == NULL) { 1378 return EFI_OUT_OF_RESOURCES; 1379 } 1380 } else { 1381 Tmp = NULL; 1382 } 1383 1384 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) { 1385 1386 DefaultRouter = Ip6FindDefaultRouter (IpSb, NewGateway + Index1); 1387 if (DefaultRouter == NULL) { 1388 Ip6CreateDefaultRouter (IpSb, NewGateway + Index1, IP6_INF_ROUTER_LIFETIME); 1389 OneAdded = TRUE; 1390 } 1391 } 1392 1393 if (!OneRemoved && !OneAdded) { 1394 Item->Status = EFI_SUCCESS; 1395 return EFI_ABORTED; 1396 } else { 1397 1398 if (Tmp != NULL) { 1399 if (Item->Data.Ptr != NULL) { 1400 FreePool (Item->Data.Ptr); 1401 } 1402 Item->Data.Ptr = Tmp; 1403 } 1404 1405 CopyMem (Item->Data.Ptr, Data, DataSize); 1406 Item->DataSize = DataSize; 1407 Item->Status = EFI_SUCCESS; 1408 return EFI_SUCCESS; 1228 1409 } 1229 1410 } else { 1230 Tmp = NULL; 1231 } 1232 1233 for (Index1 = 0; Index1 < OldGatewayCount; Index1++) { 1234 // 1235 // Find the gateways that are no long in the new setting and remove them. 1236 // 1237 for (Index2 = 0; Index2 < NewGatewayCount; Index2++) { 1238 if (EFI_IP6_EQUAL (OldGateway + Index1, NewGateway + Index2)) { 1239 OneRemoved = TRUE; 1240 break; 1241 } 1242 } 1243 1244 if (Index2 == NewGatewayCount) { 1245 // 1246 // Remove this default router. 1247 // 1248 DefaultRouter = Ip6FindDefaultRouter (IpSb, OldGateway + Index1); 1249 if (DefaultRouter != NULL) { 1250 Ip6DestroyDefaultRouter (IpSb, DefaultRouter); 1251 } 1252 } 1253 } 1254 1255 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) { 1256 1257 DefaultRouter = Ip6FindDefaultRouter (IpSb, NewGateway + Index1); 1258 if (DefaultRouter == NULL) { 1259 Ip6CreateDefaultRouter (IpSb, NewGateway + Index1, IP6_INF_ROUTER_LIFETIME); 1260 OneAdded = TRUE; 1261 } 1262 } 1263 1264 if (!OneRemoved && !OneAdded) { 1265 Item->Status = EFI_SUCCESS; 1266 return EFI_ABORTED; 1267 } else { 1268 1269 if (Tmp != NULL) { 1270 if (Item->Data.Ptr != NULL) { 1271 FreePool (Item->Data.Ptr); 1272 } 1273 Item->Data.Ptr = Tmp; 1274 } 1275 1276 CopyMem (Item->Data.Ptr, Data, DataSize); 1277 Item->DataSize = DataSize; 1278 Item->Status = EFI_SUCCESS; 1279 return EFI_SUCCESS; 1280 } 1411 // 1412 // DataSize is 0 and Data is NULL, clean up the Gateway address. 1413 // 1414 if (Item->Data.Ptr != NULL) { 1415 FreePool (Item->Data.Ptr); 1416 } 1417 Item->Data.Ptr = NULL; 1418 Item->DataSize = 0; 1419 Item->Status = EFI_NOT_FOUND; 1420 } 1421 1422 return EFI_SUCCESS; 1281 1423 } 1282 1424 … … 1312 1454 UINTN OldIndex; 1313 1455 UINTN NewIndex; 1314 UINTN Index1;1315 1456 EFI_IPv6_ADDRESS *OldDns; 1316 1457 EFI_IPv6_ADDRESS *NewDns; … … 1321 1462 VOID *Tmp; 1322 1463 1323 if ((DataSize % sizeof (EFI_IPv6_ADDRESS) != 0) || (DataSize == 0)) { 1464 OldDns = NULL; 1465 NewDns = NULL; 1466 Item = NULL; 1467 Tmp = NULL; 1468 1469 if ((DataSize != 0) && (DataSize % sizeof (EFI_IPv6_ADDRESS) != 0)) { 1324 1470 return EFI_BAD_BUFFER_SIZE; 1325 1471 } … … 1329 1475 } 1330 1476 1331 Item = &Instance->DataItem[Ip6ConfigDataTypeDnsServer]; 1332 NewDns = (EFI_IPv6_ADDRESS *) Data; 1333 OldDns = Item->Data.DnsServers; 1334 NewDnsCount = DataSize / sizeof (EFI_IPv6_ADDRESS); 1335 OldDnsCount = Item->DataSize / sizeof (EFI_IPv6_ADDRESS); 1336 OneAdded = FALSE; 1337 1338 if (NewDnsCount != OldDnsCount) { 1339 Tmp = AllocatePool (DataSize); 1340 if (Tmp == NULL) { 1341 return EFI_OUT_OF_RESOURCES; 1342 } 1343 } else { 1344 Tmp = NULL; 1345 } 1346 1347 for (NewIndex = 0; NewIndex < NewDnsCount; NewIndex++) { 1348 1349 if (!NetIp6IsValidUnicast (NewDns + NewIndex)) { 1350 // 1351 // The dns server address must be unicast. 1352 // 1353 FreePool (Tmp); 1354 return EFI_INVALID_PARAMETER; 1355 } 1356 1357 for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) { 1358 if (EFI_IP6_EQUAL (NewDns + NewIndex, NewDns + Index1)) { 1359 FreePool (Tmp); 1477 Item = &Instance->DataItem[Ip6ConfigDataTypeDnsServer]; 1478 1479 if (Data != NULL && DataSize != 0) { 1480 NewDns = (EFI_IPv6_ADDRESS *) Data; 1481 OldDns = Item->Data.DnsServers; 1482 NewDnsCount = DataSize / sizeof (EFI_IPv6_ADDRESS); 1483 OldDnsCount = Item->DataSize / sizeof (EFI_IPv6_ADDRESS); 1484 OneAdded = FALSE; 1485 1486 if (NewDnsCount != OldDnsCount) { 1487 Tmp = AllocatePool (DataSize); 1488 if (Tmp == NULL) { 1489 return EFI_OUT_OF_RESOURCES; 1490 } 1491 } else { 1492 Tmp = NULL; 1493 } 1494 1495 for (NewIndex = 0; NewIndex < NewDnsCount; NewIndex++) { 1496 1497 if (!NetIp6IsValidUnicast (NewDns + NewIndex)) { 1498 // 1499 // The dns server address must be unicast. 1500 // 1501 if (Tmp != NULL) { 1502 FreePool (Tmp); 1503 } 1360 1504 return EFI_INVALID_PARAMETER; 1361 1505 } 1362 } 1363 1364 if (OneAdded) { 1365 // 1366 // If any address in the new setting is not in the old settings, skip the 1367 // comparision below. 1368 // 1369 continue; 1370 } 1371 1372 for (OldIndex = 0; OldIndex < OldDnsCount; OldIndex++) { 1373 if (EFI_IP6_EQUAL (NewDns + NewIndex, OldDns + OldIndex)) { 1374 // 1375 // If found break out. 1376 // 1377 break; 1378 } 1379 } 1380 1381 if (OldIndex == OldDnsCount) { 1382 OneAdded = TRUE; 1383 } 1384 } 1385 1386 if (!OneAdded && (DataSize == Item->DataSize)) { 1387 // 1388 // No new item is added and the size is the same. 1389 // 1390 Item->Status = EFI_SUCCESS; 1391 return EFI_ABORTED; 1392 } else { 1393 if (Tmp != NULL) { 1394 if (Item->Data.Ptr != NULL) { 1395 FreePool (Item->Data.Ptr); 1396 } 1397 Item->Data.Ptr = Tmp; 1398 } 1399 1400 CopyMem (Item->Data.Ptr, Data, DataSize); 1401 Item->DataSize = DataSize; 1402 Item->Status = EFI_SUCCESS; 1403 return EFI_SUCCESS; 1404 } 1506 1507 if (OneAdded) { 1508 // 1509 // If any address in the new setting is not in the old settings, skip the 1510 // comparision below. 1511 // 1512 continue; 1513 } 1514 1515 for (OldIndex = 0; OldIndex < OldDnsCount; OldIndex++) { 1516 if (EFI_IP6_EQUAL (NewDns + NewIndex, OldDns + OldIndex)) { 1517 // 1518 // If found break out. 1519 // 1520 break; 1521 } 1522 } 1523 1524 if (OldIndex == OldDnsCount) { 1525 OneAdded = TRUE; 1526 } 1527 } 1528 1529 if (!OneAdded && (DataSize == Item->DataSize)) { 1530 // 1531 // No new item is added and the size is the same. 1532 // 1533 Item->Status = EFI_SUCCESS; 1534 return EFI_ABORTED; 1535 } else { 1536 if (Tmp != NULL) { 1537 if (Item->Data.Ptr != NULL) { 1538 FreePool (Item->Data.Ptr); 1539 } 1540 Item->Data.Ptr = Tmp; 1541 } 1542 1543 CopyMem (Item->Data.Ptr, Data, DataSize); 1544 Item->DataSize = DataSize; 1545 Item->Status = EFI_SUCCESS; 1546 } 1547 } else { 1548 // 1549 // DataSize is 0 and Data is NULL, clean up the DnsServer address. 1550 // 1551 if (Item->Data.Ptr != NULL) { 1552 FreePool (Item->Data.Ptr); 1553 } 1554 Item->Data.Ptr = NULL; 1555 Item->DataSize = 0; 1556 Item->Status = EFI_NOT_FOUND; 1557 } 1558 1559 return EFI_SUCCESS; 1405 1560 } 1406 1561 … … 1419 1574 ) 1420 1575 { 1421 IfInfo->Name[0] = L'e'; 1422 IfInfo->Name[1] = L't'; 1423 IfInfo->Name[2] = L'h'; 1424 IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip6ConfigInstance.IfIndex); 1425 IfInfo->Name[4] = 0; 1576 UnicodeSPrint ( 1577 IfInfo->Name, 1578 sizeof (IfInfo->Name), 1579 L"eth%d", 1580 IpSb->Ip6ConfigInstance.IfIndex 1581 ); 1426 1582 1427 1583 IfInfo->IfType = IpSb->SnpMode.IfType; … … 1492 1648 OpCode = NTOHS (OpCode); 1493 1649 1494 if (OpCode == IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS) {1650 if (OpCode == DHCP6_OPT_DNS_SERVERS) { 1495 1651 CopyMem (&Length, &OptList[Index]->OpLen, sizeof (Length)); 1496 1652 Length = NTOHS (Length); … … 1595 1751 // Decline those duplicates. 1596 1752 // 1597 Instance->Dhcp6->Decline ( 1598 Instance->Dhcp6, 1599 Instance->DeclineAddressCount, 1600 Instance->DeclineAddress 1601 ); 1753 if (Instance->Dhcp6 != NULL) { 1754 Instance->Dhcp6->Decline ( 1755 Instance->Dhcp6, 1756 Instance->DeclineAddressCount, 1757 Instance->DeclineAddress 1758 ); 1759 } 1602 1760 } 1603 1761 … … 1808 1966 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: 1809 1967 - This is NULL. 1810 - Data is NULL. 1811 - One or more fields in Data do not match the requirement of the 1812 data type indicated by DataType. 1968 - One or more fields in Data and DataSizedo not match the 1969 requirement of the data type indicated by DataType. 1813 1970 @retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified 1814 1971 configuration data cannot be set under the current policy. … … 1838 1995 IP6_SERVICE *IpSb; 1839 1996 1840 if ((This == NULL) || (Data == NULL )) {1997 if ((This == NULL) || (Data == NULL && DataSize != 0) || (Data != NULL && DataSize == 0)) { 1841 1998 return EFI_INVALID_PARAMETER; 1842 1999 } … … 2191 2348 DataItem->Data.Ptr = &Instance->Policy; 2192 2349 DataItem->DataSize = sizeof (Instance->Policy); 2193 Instance->Policy = Ip6ConfigPolicy Automatic;2350 Instance->Policy = Ip6ConfigPolicyManual; 2194 2351 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED); 2195 2352 … … 2202 2359 2203 2360 DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; 2204 DataItem->SetData = Ip6ConfigSetMa unualAddress;2361 DataItem->SetData = Ip6ConfigSetManualAddress; 2205 2362 DataItem->Status = EFI_NOT_FOUND; 2206 2363 -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.h
r58466 r77662 2 2 Definitions for EFI IPv6 Configuartion Protocol implementation. 3 3 4 Copyright (c) 2009 - 201 3, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 22 22 23 23 #define IP6_CONFIG_DEFAULT_DAD_XMITS 1 24 #define IP6_CONFIG_DHCP6_OPTION_ORO 625 #define IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS 2326 24 27 25 #define DATA_ATTRIB_SIZE_FIXED 0x1 … … 217 215 218 216 /** 217 Read the configuration data from variable storage according to the VarName and 218 gEfiIp6ConfigProtocolGuid. It checks the integrity of variable data. If the 219 data is corrupted, it clears the variable data to ZERO. Othewise, it outputs the 220 configuration data to IP6_CONFIG_INSTANCE. 221 222 @param[in] VarName The pointer to the variable name 223 @param[in, out] Instance The pointer to the IP6 config instance data. 224 225 @retval EFI_NOT_FOUND The variable can not be found or already corrupted. 226 @retval EFI_OUT_OF_RESOURCES Fail to allocate resource to complete the operation. 227 @retval EFI_SUCCESS The configuration data was retrieved successfully. 228 229 **/ 230 EFI_STATUS 231 Ip6ConfigReadConfigData ( 232 IN CHAR16 *VarName, 233 IN OUT IP6_CONFIG_INSTANCE *Instance 234 ); 235 236 /** 219 237 The event process routine when the DHCPv6 server is answered with a reply packet 220 238 for an information request. -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Driver.c
r58466 r77662 2 2 The driver binding and service binding protocol for IP6 driver. 3 3 4 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 5 6 6 7 This program and the accompanying materials … … 25 26 }; 26 27 28 BOOLEAN mIpSec2Installed = FALSE; 29 30 /** 31 Callback function for IpSec2 Protocol install. 32 33 @param[in] Event Event whose notification function is being invoked 34 @param[in] Context Pointer to the notification function's context 35 36 **/ 37 VOID 38 EFIAPI 39 IpSec2InstalledCallback ( 40 IN EFI_EVENT Event, 41 IN VOID *Context 42 ) 43 { 44 EFI_STATUS Status; 45 // 46 // Test if protocol was even found. 47 // Notification function will be called at least once. 48 // 49 Status = gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **)&mIpSec); 50 if (Status == EFI_SUCCESS && mIpSec != NULL) { 51 // 52 // Close the event so it does not get called again. 53 // 54 gBS->CloseEvent (Event); 55 56 mIpSec2Installed = TRUE; 57 } 58 } 59 27 60 /** 28 61 This is the declaration of an EFI image entry point. This entry point is … … 47 80 ) 48 81 { 82 VOID *Registration; 83 84 EfiCreateProtocolNotifyEvent ( 85 &gEfiIpSec2ProtocolGuid, 86 TPL_CALLBACK, 87 IpSec2InstalledCallback, 88 NULL, 89 &Registration 90 ); 91 49 92 return EfiLibInstallDriverBindingComponentName2 ( 50 93 ImageHandle, … … 112 155 EFI_IPv6_ADDRESS AllNodes; 113 156 IP6_NEIGHBOR_ENTRY *NeighborCache; 157 158 IpSb->State = IP6_SERVICE_DESTROY; 159 160 if (IpSb->Timer != NULL) { 161 gBS->SetTimer (IpSb->Timer, TimerCancel, 0); 162 gBS->CloseEvent (IpSb->Timer); 163 164 IpSb->Timer = NULL; 165 } 166 167 if (IpSb->FasterTimer != NULL) { 168 gBS->SetTimer (IpSb->FasterTimer, TimerCancel, 0); 169 gBS->CloseEvent (IpSb->FasterTimer); 170 171 IpSb->FasterTimer = NULL; 172 } 114 173 115 174 Ip6ConfigCleanInstance (&IpSb->Ip6ConfigInstance); … … 178 237 } 179 238 180 if (IpSb->Timer != NULL) {181 gBS->SetTimer (IpSb->Timer, TimerCancel, 0);182 gBS->CloseEvent (IpSb->Timer);183 184 IpSb->Timer = NULL;185 }186 187 if (IpSb->FasterTimer != NULL) {188 gBS->SetTimer (IpSb->FasterTimer, TimerCancel, 0);189 gBS->CloseEvent (IpSb->FasterTimer);190 191 IpSb->FasterTimer = NULL;192 }193 239 // 194 240 // Free the Neighbor Discovery resources … … 226 272 EFI_MANAGED_NETWORK_COMPLETION_TOKEN *MnpToken; 227 273 EFI_MANAGED_NETWORK_CONFIG_DATA *Config; 228 IP6_CONFIG_DATA_ITEM *DataItem;229 274 230 275 ASSERT (Service != NULL); … … 440 485 } 441 486 442 //443 // If there is any manual address, set it.444 //445 DataItem = &IpSb->Ip6ConfigInstance.DataItem[Ip6ConfigDataTypeManualAddress];446 if (DataItem->Data.Ptr != NULL) {447 DataItem->SetData (448 &IpSb->Ip6ConfigInstance,449 DataItem->DataSize,450 DataItem->Data.Ptr451 );452 }453 454 //455 // If there is any gateway address, set it.456 //457 DataItem = &IpSb->Ip6ConfigInstance.DataItem[Ip6ConfigDataTypeGateway];458 if (DataItem->Data.Ptr != NULL) {459 DataItem->SetData (460 &IpSb->Ip6ConfigInstance,461 DataItem->DataSize,462 DataItem->Data.Ptr463 );464 }465 466 487 InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link); 467 488 … … 499 520 IP6_SERVICE *IpSb; 500 521 EFI_STATUS Status; 522 EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg; 523 IP6_CONFIG_DATA_ITEM *DataItem; 524 525 IpSb = NULL; 526 Ip6Cfg = NULL; 527 DataItem = NULL; 501 528 502 529 // … … 524 551 ASSERT (IpSb != NULL); 525 552 553 Ip6Cfg = &IpSb->Ip6ConfigInstance.Ip6Config; 554 526 555 // 527 556 // Install the Ip6ServiceBinding Protocol onto ControlerHandle … … 532 561 &IpSb->ServiceBinding, 533 562 &gEfiIp6ConfigProtocolGuid, 534 &IpSb->Ip6ConfigInstance.Ip6Config,563 Ip6Cfg, 535 564 NULL 536 565 ); 537 538 if (!EFI_ERROR (Status)) { 539 // 540 // ready to go: start the receiving and timer 541 // 542 Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb); 543 if (EFI_ERROR (Status)) { 566 if (EFI_ERROR (Status)) { 567 goto ON_ERROR; 568 } 569 570 // 571 // Read the config data from NV variable again. 572 // The default data can be changed by other drivers. 573 // 574 Status = Ip6ConfigReadConfigData (IpSb->MacString, &IpSb->Ip6ConfigInstance); 575 if (EFI_ERROR (Status)) { 576 goto ON_ERROR; 577 } 578 579 // 580 // If there is any default manual address, set it. 581 // 582 DataItem = &IpSb->Ip6ConfigInstance.DataItem[Ip6ConfigDataTypeManualAddress]; 583 if (DataItem->Data.Ptr != NULL) { 584 Status = Ip6Cfg->SetData ( 585 Ip6Cfg, 586 Ip6ConfigDataTypeManualAddress, 587 DataItem->DataSize, 588 DataItem->Data.Ptr 589 ); 590 if (EFI_ERROR(Status) && Status != EFI_NOT_READY) { 544 591 goto ON_ERROR; 545 592 } 546 547 // 548 // The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds. 549 // 550 Status = gBS->SetTimer ( 551 IpSb->FasterTimer, 552 TimerPeriodic, 553 TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS 554 ); 555 if (EFI_ERROR (Status)) { 593 } 594 595 // 596 // If there is any default gateway address, set it. 597 // 598 DataItem = &IpSb->Ip6ConfigInstance.DataItem[Ip6ConfigDataTypeGateway]; 599 if (DataItem->Data.Ptr != NULL) { 600 Status = Ip6Cfg->SetData ( 601 Ip6Cfg, 602 Ip6ConfigDataTypeGateway, 603 DataItem->DataSize, 604 DataItem->Data.Ptr 605 ); 606 if (EFI_ERROR(Status)) { 556 607 goto ON_ERROR; 557 608 } 558 559 // 560 // The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds. 561 // 562 Status = gBS->SetTimer ( 563 IpSb->Timer, 564 TimerPeriodic, 565 TICKS_PER_MS * IP6_ONE_SECOND_IN_MS 566 ); 567 if (EFI_ERROR (Status)) { 568 goto ON_ERROR; 569 } 570 571 // 572 // Initialize the IP6 ID 573 // 574 mIp6Id = NET_RANDOM (NetRandomInitSeed ()); 575 576 return EFI_SUCCESS; 577 } 609 } 610 611 // 612 // ready to go: start the receiving and timer 613 // 614 Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb); 615 if (EFI_ERROR (Status)) { 616 goto ON_ERROR; 617 } 618 619 // 620 // The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds. 621 // 622 Status = gBS->SetTimer ( 623 IpSb->FasterTimer, 624 TimerPeriodic, 625 TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS 626 ); 627 if (EFI_ERROR (Status)) { 628 goto ON_ERROR; 629 } 630 631 // 632 // The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds. 633 // 634 Status = gBS->SetTimer ( 635 IpSb->Timer, 636 TimerPeriodic, 637 TICKS_PER_MS * IP6_ONE_SECOND_IN_MS 638 ); 639 if (EFI_ERROR (Status)) { 640 goto ON_ERROR; 641 } 642 643 // 644 // Initialize the IP6 ID 645 // 646 mIp6Id = NET_RANDOM (NetRandomInitSeed ()); 647 648 return EFI_SUCCESS; 578 649 579 650 ON_ERROR: … … 698 769 } else if (IsListEmpty (&IpSb->Children)) { 699 770 State = IpSb->State; 700 IpSb->State = IP6_SERVICE_DESTROY;701 702 771 Status = Ip6CleanService (IpSb); 703 772 if (EFI_ERROR (Status)) { … … 734 803 735 804 @retval EFI_SUCCES The child handle was created with the I/O services. 736 @retval EFI_OUT_OF_RESOURCES There are not enough resources availab e to create805 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create 737 806 the child. 738 807 @retval other The child handle was not created. -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Driver.h
r58459 r77662 2 2 The driver binding and service binding protocol for IP6 driver. 3 3 4 Copyright (c) 2009 - 201 2, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 142 142 143 143 // 144 // Function p tototypes for the ServiceBinding Prococol144 // Function prototypes for the ServiceBinding Protocol 145 145 // 146 146 … … 155 155 156 156 @retval EFI_SUCCES The child handle was created with the I/O services. 157 @retval EFI_OUT_OF_RESOURCES There are not enough resources availab e to create157 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create 158 158 the child. 159 159 @retval other The child handle was not created. -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Dxe.inf
r58466 r77662 8 8 # the EFI IPv6 network stack. 9 9 # 10 # Copyright (c) 2009 - 201 4, Intel Corporation. All rights reserved.<BR>10 # Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 11 11 # 12 12 # This program and the accompanying materials -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Dxe.uni
r58464 r77662 1 // /** @file1 // /** @file 2 2 // Basic IPv6 packet I/O Service. 3 3 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6DxeExtra.uni
r58464 r77662 1 // /** @file1 // /** @file 2 2 // Ip6Dxe Localized Strings and Content 3 3 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni
r58466 r77662 1 /** @file1 /** @file 2 2 String definitions for IP6 configuration. 3 3 -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Icmp.c
r48674 r77662 2 2 The ICMPv6 handle routines to process the ICMPv6 control messages. 3 3 4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> 4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> 5 6 6 7 This program and the accompanying materials … … 473 474 UINT8 Value; 474 475 475 ASSERT ((Prefix != NULL) && (PrefixLength < IP6_PREFIX_ NUM));476 ASSERT ((Prefix != NULL) && (PrefixLength < IP6_PREFIX_MAX)); 476 477 477 478 if (PrefixLength == 0) { … … 480 481 } 481 482 482 if (PrefixLength == IP6_PREFIX_NUM - 1) {483 if (PrefixLength >= IP6_PREFIX_MAX) { 483 484 return ; 484 485 } … … 488 489 Value = Prefix->Addr[Byte]; 489 490 490 if ( (Byte > 0) && (Byte < 16)) {491 if (Byte > 0) { 491 492 ZeroMem (Prefix->Addr + Byte, 16 - Byte); 492 493 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Impl.c
r58459 r77662 2 2 Implementation of EFI_IP6_PROTOCOL protocol interfaces. 3 3 4 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 4 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> 5 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 6 6 7 This program and the accompanying materials … … 842 843 IP6_SERVICE *IpSb; 843 844 844 if ((This == NULL) || (PrefixLength > = IP6_PREFIX_NUM)) {845 if ((This == NULL) || (PrefixLength > IP6_PREFIX_MAX)) { 845 846 return EFI_INVALID_PARAMETER; 846 847 } … … 1762 1763 { 1763 1764 IP6_PROTOCOL *IpInstance; 1764 IP6_SERVICE *IpSb;1765 1765 EFI_STATUS Status; 1766 1766 EFI_TPL OldTpl; … … 1771 1771 1772 1772 IpInstance = IP6_INSTANCE_FROM_PROTOCOL (This); 1773 IpSb = IpInstance->Service;1774 1773 1775 1774 OldTpl = gBS->RaiseTPL (TPL_CALLBACK); -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Impl.h
r58459 r77662 2 2 Implementation of EFI_IP6_PROTOCOL protocol interfaces and type definitions. 3 3 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR> 4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 5 6 6 7 This program and the accompanying materials … … 18 19 19 20 #include <Uefi.h> 21 22 #include <IndustryStandard/Dhcp.h> 20 23 21 24 #include <Protocol/ServiceBinding.h> … … 90 93 91 94 extern EFI_IPSEC2_PROTOCOL *mIpSec; 95 extern BOOLEAN mIpSec2Installed; 92 96 93 97 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Input.c
r58466 r77662 2 2 IP6 internal functions to process the incoming packets. 3 3 4 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> 4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> 5 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> 5 6 6 7 This program and the accompanying materials … … 526 527 527 528 Status = EFI_SUCCESS; 529 530 if (!mIpSec2Installed) { 531 goto ON_EXIT; 532 } 533 ASSERT (mIpSec != NULL); 534 528 535 Packet = *Netbuf; 529 536 RecycleEvent = NULL; … … 535 542 FragmentCount = Packet->BlockOpNum; 536 543 ZeroMem (&ZeroHead, sizeof (EFI_IP6_HEADER)); 537 538 if (mIpSec == NULL) {539 gBS->LocateProtocol (&gEfiIpSec2ProtocolGuid, NULL, (VOID **) &mIpSec);540 541 //542 // Check whether the ipsec protocol is available.543 //544 if (mIpSec == NULL) {545 goto ON_EXIT;546 }547 }548 544 549 545 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Nd.c
r58466 r77662 2 2 Implementation of Neighbor Discovery support routines. 3 3 4 Copyright (c) 2009 - 201 2, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 199 199 IP6_PREFIX_LIST_ENTRY *TmpPrefixEntry; 200 200 201 if (Prefix == NULL || PreferredLifetime > ValidLifetime || PrefixLength > = IP6_PREFIX_NUM) {201 if (Prefix == NULL || PreferredLifetime > ValidLifetime || PrefixLength > IP6_PREFIX_MAX) { 202 202 return NULL; 203 203 } … … 854 854 // 855 855 Oro = (EFI_DHCP6_PACKET_OPTION *) OptBuf; 856 Oro->OpCode = HTONS ( IP6_CONFIG_DHCP6_OPTION_ORO);856 Oro->OpCode = HTONS (DHCP6_OPT_ORO); 857 857 Oro->OpLen = HTONS (2); 858 *((UINT16 *) &Oro->Data[0]) = HTONS ( IP6_CONFIG_DHCP6_OPTION_DNS_SERVERS);858 *((UINT16 *) &Oro->Data[0]) = HTONS (DHCP6_OPT_DNS_SERVERS); 859 859 860 860 InfoReqReXmit.Irt = 4; … … 982 982 NET_CHECK_SIGNATURE (IpIf, IP6_INTERFACE_SIGNATURE); 983 983 ASSERT (AddressInfo != NULL); 984 985 // 986 // Do nothing if we have already started DAD on the address. 987 // 988 if (Ip6FindDADEntry (IpIf->Service, &AddressInfo->Address, NULL) != NULL) { 989 return EFI_SUCCESS; 990 } 984 991 985 992 Status = EFI_SUCCESS; … … 1578 1585 DupAddrDetect = Ip6FindDADEntry (IpSb, &Target, &IpIf); 1579 1586 if (DupAddrDetect != NULL) { 1580 if (DupAddrDetect->Transmit == 0) {1581 //1582 // The NS is from another node to performing DAD on the same address since1583 // we haven't send out any NS yet. Fail DAD for the tentative address.1584 //1585 Ip6OnDADFinished (FALSE, IpIf, DupAddrDetect);1586 Status = EFI_ICMP_ERROR;1587 goto Exit;1588 }1589 1590 1587 // 1591 1588 // Check the MAC address of the incoming packet. … … 2864 2861 Flag = FALSE; 2865 2862 if ((DupAddrDetect->Receive == 0) || 2866 (DupAddrDetect->Transmit == DupAddrDetect->Receive)) {2863 (DupAddrDetect->Transmit <= DupAddrDetect->Receive)) { 2867 2864 Flag = TRUE; 2868 2865 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Option.c
r48674 r77662 19 19 Validate the IP6 option format for both the packets we received 20 20 and that we will transmit. It will compute the ICMPv6 error message fields 21 if the option is malformat ed.21 if the option is malformatted. 22 22 23 23 @param[in] IpSb The IP6 service data. … … 30 30 31 31 @retval TRUE The option is properly formatted. 32 @retval FALSE The option is malformat ed.32 @retval FALSE The option is malformatted. 33 33 34 34 **/ … … 127 127 128 128 @retval TRUE The option is properly formatted. 129 @retval FALSE The option is malformat ed.129 @retval FALSE The option is malformatted. 130 130 131 131 **/ … … 232 232 Validate the IP6 extension header format for both the packets we received 233 233 and that we will transmit. It will compute the ICMPv6 error message fields 234 if the option is mal-format ed.234 if the option is mal-formatted. 235 235 236 236 @param[in] IpSb The IP6 service instance. This is an optional parameter. … … 253 253 This is an optional parameter that may be NULL. 254 254 255 @retval TRUE The option is properly format ed.256 @retval FALSE The option is malformat ed.255 @retval TRUE The option is properly formatted. 256 @retval FALSE The option is malformatted. 257 257 258 258 **/ … … 437 437 // 438 438 // RFC2460, ICMP Parameter Problem message with code 0 should be sent 439 // if the length of a fragment is not a multiple of 8 octe cts and the M439 // if the length of a fragment is not a multiple of 8 octets and the M 440 440 // flag of that fragment is 1, pointing to the Payload length field of the 441 441 // fragment packet. … … 607 607 @param[in] FragmentOffset The fragment offset of the data following the header. 608 608 @param[out] UpdatedExtHdrs The updated ExtHdrs with Fragment header inserted. 609 It's caller's responsib lity to free this buffer.609 It's caller's responsibility to free this buffer. 610 610 611 611 @retval EFI_OUT_OF_RESOURCES Failed to finish the operation due to lake of -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Option.h
r48674 r77662 52 52 Validate the IP6 extension header format for both the packets we received 53 53 and that we will transmit. It will compute the ICMPv6 error message fields 54 if the option is mal-format ed.54 if the option is mal-formatted. 55 55 56 56 @param[in] IpSb The IP6 service instance. This is an optional parameter. … … 73 73 This is an optional parameter that may be NULL. 74 74 75 @retval TRUE The option is properly format ed.76 @retval FALSE The option is malformat ed.75 @retval TRUE The option is properly formatted. 76 @retval FALSE The option is malformatted. 77 77 78 78 **/ … … 123 123 @param[in] FragmentOffset The fragment offset of the data following the header. 124 124 @param[out] UpdatedExtHdrs The updated ExtHdrs with Fragment header inserted. 125 It's caller's responsib lity to free this buffer.125 It's caller's responsibility to free this buffer. 126 126 127 127 @retval EFI_OUT_OF_RESOURCES Failed to finish the operation due to lake of … … 180 180 181 181 @retval TRUE The option is properly formatted. 182 @retval FALSE The option is malformat ed.182 @retval FALSE The option is malformatted. 183 183 184 184 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Output.c
r58459 r77662 2 2 The internal functions and routines to transmit the IP6 packet. 3 3 4 Copyright (c) 2009 - 201 4, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 24 24 @param[in] IpSb Points to an IP6 service binding instance. 25 25 @param[out] SourceList The list entry head of all source addresses. 26 It is the caller's responsib lity to free the26 It is the caller's responsibility to free the 27 27 resources. 28 28 @param[out] SourceCount The number of source addresses. … … 92 92 93 93 /** 94 Ca culate how many bits are the same between two IPv6 addresses.94 Calculate how many bits are the same between two IPv6 addresses. 95 95 96 96 @param[in] AddressA Points to an IPv6 address. … … 365 365 @param[in] HeadLen The length of the unfragmented part of the IP6 header. 366 366 367 @retval EFI_BAD_BUFFER_SIZE There is no enough troom in the head space of367 @retval EFI_BAD_BUFFER_SIZE There is no enough room in the head space of 368 368 Packet. 369 369 @retval EFI_SUCCESS The operation performed successfully. … … 727 727 728 728 // 729 // Send out multicast neighbor solicitation for address resolution immediat ly.729 // Send out multicast neighbor solicitation for address resolution immediately. 730 730 // 731 731 Ip6CreateSNMulticastAddr (&NeighborCache->Neighbor, &Destination); … … 810 810 // OK, selected the source and route, fragment the packet then send 811 811 // them. Tag each fragment other than the first one as spawn from it. 812 // Each extension header is an integ ar multiple of 8 octets long, in812 // Each extension header is an integer multiple of 8 octets long, in 813 813 // order to retain 8-octet alignment for subsequent headers. 814 814 // -
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/Ip6Dxe/Ip6Route.c
r48674 r77662 2 2 The functions and routines to handle the route caches and route table. 3 3 4 Copyright (c) 2009 - 201 0, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> 5 5 6 6 This program and the accompanying materials … … 136 136 RtEntry = NULL; 137 137 138 for (Index = IP6_PREFIX_ NUM - 1; Index >= 0; Index--) {138 for (Index = IP6_PREFIX_MAX; Index >= 0; Index--) { 139 139 NET_LIST_FOR_EACH (Entry, &RtTable->RouteArea[Index]) { 140 140 RtEntry = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_ENTRY, Link); … … 301 301 Count = 0; 302 302 303 for (Index = IP6_PREFIX_ NUM - 1; Index >= 0; Index--) {303 for (Index = IP6_PREFIX_MAX; Index >= 0; Index--) { 304 304 305 305 NET_LIST_FOR_EACH (Entry, &(RouteTable->RouteArea[Index])) { … … 347 347 RtTable->TotalNum = 0; 348 348 349 for (Index = 0; Index < IP6_PREFIX_NUM; Index++) {349 for (Index = 0; Index <= IP6_PREFIX_MAX; Index++) { 350 350 InitializeListHead (&RtTable->RouteArea[Index]); 351 351 } … … 386 386 // Free all the route table entry and its route cache. 387 387 // 388 for (Index = 0; Index < IP6_PREFIX_NUM; Index++) {388 for (Index = 0; Index <= IP6_PREFIX_MAX; Index++) { 389 389 NET_LIST_FOR_EACH_SAFE (Entry, Next, &RtTable->RouteArea[Index]) { 390 390 RtEntry = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_ENTRY, Link);
Note:
See TracChangeset
for help on using the changeset viewer.