\r
IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);\r
\r
+ //\r
+ // Check whether the StationAddress/SubnetMask pair is valid.\r
+ //\r
+ if (!Ip4StationAddressValid (StationAddress, SubnetMask)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
Status = Ip4Config2SetDefaultAddr (IpSb, StationAddress, SubnetMask);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
{\r
UINTN OldIndex;\r
UINTN NewIndex;\r
- UINTN Index1;\r
EFI_IPv4_ADDRESS *OldDns;\r
EFI_IPv4_ADDRESS *NewDns;\r
UINTN OldDnsCount;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- for (Index1 = NewIndex + 1; Index1 < NewDnsCount; Index1++) {\r
- if (EFI_IP4_EQUAL (NewDns + NewIndex, NewDns + Index1)) {\r
- if (Tmp != NULL) {\r
- FreePool (Tmp);\r
- }\r
- return EFI_INVALID_PARAMETER;\r
- }\r
- }\r
-\r
if (OneAdded) {\r
//\r
// If any address in the new setting is not in the old settings, skip the\r
StationAddress = EFI_NTOHL (NewAddress.Address);\r
SubnetMask = EFI_NTOHL (NewAddress.SubnetMask);\r
\r
- if (NetGetMaskLength (SubnetMask) == IP4_MASK_NUM) {\r
+ //\r
+ // Check whether the StationAddress/SubnetMask pair is valid.\r
+ //\r
+ if (!Ip4StationAddressValid (StationAddress, SubnetMask)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r