summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-26 09:29:46 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-26 09:29:46 +0000
commit501793fad4084c43828ba2f4e2d9355d29abe9f7 (patch)
treeac49b115a60da8a6d1fd0ae42eff53c29d113acb /NetworkPkg
parent8f5e3a12a9dc5f5b782204ee655db6cb22e25ea5 (diff)
Adopt new IPv4/IPv6 device path for network modules.
Signed-off-by: tye Reviewed-by: niruiyu Adopt SasEx and new IPv6 device path for DevicePathDxe driver. Signed-off-by: niruiyu Reviewed-by: erictian git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12574 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiMisc.c18
-rw-r--r--NetworkPkg/TcpDxe/TcpMisc.c4
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c2
3 files changed, 20 insertions, 4 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index 731081f1d..f3ecdb5f6 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -1287,11 +1287,25 @@ IScsiGetTcpConnDevicePath (
if (DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) {
if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {
DPathNode->Ipv4.LocalPort = 0;
- DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;
+
+ DPathNode->Ipv4.StaticIpAddress =
+ (BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);
+
+ IP4_COPY_ADDRESS (
+ &DPathNode->Ipv4.GatewayIpAddress,
+ &Session->ConfigData->SessionConfigData.Gateway
+ );
+
+ IP4_COPY_ADDRESS (
+ &DPathNode->Ipv4.SubnetMask,
+ &Session->ConfigData->SessionConfigData.SubnetMask
+ );
break;
} else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {
DPathNode->Ipv6.LocalPort = 0;
- DPathNode->Ipv6.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;
+ DPathNode->Ipv6.IpAddressOrigin = 0;
+ DPathNode->Ipv6.PrefixLength = IP6_PREFIX_LENGTH;
+ ZeroMem (&DPathNode->Ipv6.GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));
break;
}
}
diff --git a/NetworkPkg/TcpDxe/TcpMisc.c b/NetworkPkg/TcpDxe/TcpMisc.c
index 492ec35fb..21bd9dfec 100644
--- a/NetworkPkg/TcpDxe/TcpMisc.c
+++ b/NetworkPkg/TcpDxe/TcpMisc.c
@@ -1,7 +1,7 @@
/** @file
Misc support routines for TCP driver.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2011, 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
@@ -1245,6 +1245,8 @@ TcpInstallDevicePath (
Tcb->UseDefaultAddr
);
+ IP4_COPY_ADDRESS (&Ip4DPathNode.SubnetMask, &Tcb->SubnetMask);
+
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) &Ip4DPathNode;
} else {
NetLibCreateIPv6DPathNode (
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
index 8cfc8fb93..179009f91 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
@@ -949,7 +949,7 @@ PxeBcCreateIp6Children (
ZeroMem (&Ip6Node, sizeof (IPv6_DEVICE_PATH));
Ip6Node.Header.Type = MESSAGING_DEVICE_PATH;
Ip6Node.Header.SubType = MSG_IPv6_DP;
- Ip6Node.StaticIpAddress = FALSE;
+ Ip6Node.PrefixLength = IP6_PREFIX_LENGTH;
SetDevicePathNodeLength (&Ip6Node.Header, sizeof (Ip6Node));