diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2016-10-27 09:23:22 +0800 |
---|---|---|
committer | Fu Siyuan <siyuan.fu@intel.com> | 2016-10-28 14:20:25 +0800 |
commit | 6c12fe63f989b1a3aff9f44c22b2833fa78cfcab (patch) | |
tree | d47804634feabe9f85166f74b31ff1d98b2e0aea /NetworkPkg/TcpDxe | |
parent | 01b5ac880f00cf89833e6fc80666bccc9779dea7 (diff) | |
download | edk2-platforms-6c12fe63f989b1a3aff9f44c22b2833fa78cfcab.tar.xz |
NetworkPkg: Update IP4 stack drivers for classless address unicast check.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/TcpDxe')
-rw-r--r-- | NetworkPkg/TcpDxe/TcpMain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c index 96a295a7fe..03942ee32e 100644 --- a/NetworkPkg/TcpDxe/TcpMain.c +++ b/NetworkPkg/TcpDxe/TcpMain.c @@ -147,10 +147,10 @@ Tcp4Configure ( if (NULL != TcpConfigData) {
CopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
- if ((Ip != 0) && !NetIp4IsUnicast (NTOHL (Ip), 0)) {
+ if (IP4_IS_LOCAL_BROADCAST (NTOHL (Ip))) {
return EFI_INVALID_PARAMETER;
}
-
+
if (TcpConfigData->AccessPoint.ActiveFlag && (0 == TcpConfigData->AccessPoint.RemotePort || (Ip == 0))) {
return EFI_INVALID_PARAMETER;
}
@@ -159,7 +159,7 @@ Tcp4Configure ( CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
- if (!NetIp4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (SubnetMask))) {
+ if (!IP4_IS_VALID_NETMASK (NTOHL (SubnetMask)) || !NetIp4IsUnicast (NTOHL (Ip), NTOHL (SubnetMask))) {
return EFI_INVALID_PARAMETER;
}
}
|