diff options
author | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-13 06:47:06 +0000 |
---|---|---|
committer | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-13 06:47:06 +0000 |
commit | 216f79703b8cb8dc65abdd768bedb2bcdbc1a1f8 (patch) | |
tree | 847cafec4185c79f082ccb9a5e895062a06980c1 /NetworkPkg/IScsiDxe/IScsiDhcp6.c | |
parent | 906e1cb7f7f178f5cb2a3bebbac59f6aa8c273a4 (diff) | |
download | edk2-platforms-216f79703b8cb8dc65abdd768bedb2bcdbc1a1f8.tar.xz |
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
2. Fix the driver binding Stop() hang issue in the network stack.
3. Add Ip4 raw data support.
4. Add iSCSI Dhcp option 60 support.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ouyang Qian <qian.ouyang@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13995 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/IScsiDxe/IScsiDhcp6.c')
-rw-r--r-- | NetworkPkg/IScsiDxe/IScsiDhcp6.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c b/NetworkPkg/IScsiDxe/IScsiDhcp6.c index 2bf102ba8b..2627a59dd6 100644 --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c @@ -1,7 +1,7 @@ /** @file
iSCSI DHCP6 related configuration routines.
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -250,6 +250,7 @@ IScsiDhcp6ParseReply ( EFI_DHCP6_PACKET_OPTION *BootFileOpt;
EFI_DHCP6_PACKET_OPTION **OptionList;
ISCSI_ATTEMPT_CONFIG_NVDATA *ConfigData;
+ UINT16 ParaLen;
OptionCount = 0;
BootFileOpt = NULL;
@@ -282,7 +283,7 @@ IScsiDhcp6ParseReply ( if (OptionList[Index]->OpCode == DHCP6_OPT_DNS_SERVERS) {
if (((OptionList[Index]->OpLen & 0xf) != 0) || (OptionList[Index]->OpLen == 0)) {
- Status = EFI_INVALID_PARAMETER;
+ Status = EFI_UNSUPPORTED;
goto Exit;
}
//
@@ -302,6 +303,24 @@ IScsiDhcp6ParseReply ( // The server sends this option to inform the client about an URL to a boot file.
//
BootFileOpt = OptionList[Index];
+ } else if (OptionList[Index]->OpCode == DHCP6_OPT_BOOT_FILE_PARA) {
+ //
+ // The server sends this option to inform the client about DHCP6 server address.
+ //
+ if (OptionList[Index]->OpLen < 18) {
+ Status = EFI_UNSUPPORTED;
+ goto Exit;
+ }
+ //
+ // Check param-len 1, should be 16 bytes.
+ //
+ CopyMem (&ParaLen, &OptionList[Index]->Data[0], sizeof (UINT16));
+ if (NTOHS (ParaLen) != 16) {
+ Status = EFI_UNSUPPORTED;
+ goto Exit;
+ }
+
+ CopyMem (&ConfigData->DhcpServer, &OptionList[Index]->Data[2], sizeof (EFI_IPv6_ADDRESS));
}
}
@@ -405,7 +424,7 @@ IScsiDoDhcp6 ( goto ON_EXIT;
}
- Oro = AllocateZeroPool (sizeof (EFI_DHCP6_PACKET_OPTION) + 3);
+ Oro = AllocateZeroPool (sizeof (EFI_DHCP6_PACKET_OPTION) + 5);
if (Oro == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
@@ -416,9 +435,10 @@ IScsiDoDhcp6 ( // All members in EFI_DHCP6_PACKET_OPTION are in network order.
//
Oro->OpCode = HTONS (DHCP6_OPT_REQUEST_OPTION);
- Oro->OpLen = HTONS (2 * 2);
+ Oro->OpLen = HTONS (2 * 3);
Oro->Data[1] = DHCP6_OPT_DNS_SERVERS;
Oro->Data[3] = DHCP6_OPT_BOOT_FILE_URL;
+ Oro->Data[5] = DHCP6_OPT_BOOT_FILE_PARA;
InfoReqReXmit.Irt = 4;
InfoReqReXmit.Mrc = 1;
|