From 6c12fe63f989b1a3aff9f44c22b2833fa78cfcab Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Thu, 27 Oct 2016 09:23:22 +0800 Subject: NetworkPkg: Update IP4 stack drivers for classless address unicast check. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Wu Jiaxin --- NetworkPkg/TcpDxe/TcpMain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'NetworkPkg/TcpDxe') diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c index 96a295a..03942ee 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; } } -- cgit v1.1