\r
NewAddress = *((EFI_IP4_CONFIG2_MANUAL_ADDRESS *) Data);\r
\r
+ StationAddress = EFI_NTOHL (NewAddress.Address);\r
+ SubnetMask = EFI_NTOHL (NewAddress.SubnetMask);\r
+\r
+ if (NetGetMaskLength (SubnetMask) == IP4_MASK_NUM) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
//\r
// Store the new data, and init the DataItem status to EFI_NOT_READY because\r
// we may have an asynchronous configuration process.\r
DataItem->DataSize = DataSize;\r
DataItem->Status = EFI_NOT_READY;\r
\r
- StationAddress = EFI_NTOHL (NewAddress.Address);\r
- SubnetMask = EFI_NTOHL (NewAddress.SubnetMask);\r
-\r
IpSb->Reconfig = TRUE;\r
Status = Ip4Config2SetDefaultAddr (IpSb, StationAddress, SubnetMask);\r
if (EFI_ERROR (Status)) {\r
\r
NET_CHECK_SIGNATURE (Interface, IP4_INTERFACE_SIGNATURE);\r
\r
+ Len = NetGetMaskLength (SubnetMask);\r
+ if (Len == IP4_MASK_NUM) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
//\r
// Set the ip/netmask, then compute the subnet broadcast\r
// and network broadcast for easy access. When computing\r
Interface->Ip = IpAddr;\r
Interface->SubnetMask = SubnetMask;\r
Interface->SubnetBrdcast = (IpAddr | ~SubnetMask);\r
-\r
- Len = NetGetMaskLength (SubnetMask);\r
- ASSERT (Len <= IP4_MASK_MAX);\r
Interface->NetBrdcast = (IpAddr | ~SubnetMask);\r
\r
//\r