X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Impl.c;fp=MdeModulePkg%2FUniversal%2FNetwork%2FIp4Dxe%2FIp4Impl.c;h=5aa3ea137599cde6f4a60cbe6414130d407b0a3f;hb=f1222593f2a8944ab8f61f3864b6ae80633faecf;hp=91f1a67370e79279abfe99e895eec2daa6b2b708;hpb=d948cf838edd02ad2c3c39c870ea751d4c33f337;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 91f1a67370..5aa3ea1375 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
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 @@ -809,66 +809,6 @@ Ip4CleanProtocol ( } -/** - Validate that Ip/Netmask pair is OK to be used as station - address. Only continuous netmasks are supported. and check - that StationAddress is a unicast address on the newtwork. - - @param[in] Ip The IP address to validate. - @param[in] Netmask The netmaks of the IP. - - @retval TRUE The Ip/Netmask pair is valid. - @retval FALSE The Ip/Netmask pair is invalid. - -**/ -BOOLEAN -Ip4StationAddressValid ( - IN IP4_ADDR Ip, - IN IP4_ADDR Netmask - ) -{ - IP4_ADDR NetBrdcastMask; - INTN Len; - INTN Type; - - // - // Only support the station address with 0.0.0.0/0 to enable DHCP client. - // - if (Netmask == IP4_ALLZERO_ADDRESS) { - return (BOOLEAN) (Ip == IP4_ALLZERO_ADDRESS); - } - - // - // Only support the continuous net masks - // - if ((Len = NetGetMaskLength (Netmask)) == (IP4_MASK_MAX + 1)) { - return FALSE; - } - - // - // Station address can't be class D or class E address - // - if ((Type = NetGetIpClass (Ip)) > IP4_ADDR_CLASSC) { - return FALSE; - } - - // - // Station address can't be subnet broadcast/net broadcast address - // - if ((Ip == (Ip & Netmask)) || (Ip == (Ip | ~Netmask))) { - return FALSE; - } - - NetBrdcastMask = gIp4AllMasks[MIN (Len, Type << 3)]; - - if (Ip == (Ip | ~NetBrdcastMask)) { - return FALSE; - } - - return TRUE; -} - - /** Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.