MdeModulePkg\Library\DxeNetLib: Update the NetLibStrToIp6andPrefix() to return different values for two situations - a. The Input string doesn’t contain the prefix length; b. The prefix length contains prefix length and the prefix length is zero.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9898 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qianouyang 2010-02-01 09:53:52 +00:00
parent 337661bb8c
commit 04bb6788dd
1 changed files with 6 additions and 2 deletions

View File

@ -2759,14 +2759,18 @@ NetLibStrToIp6andPrefix (
goto Exit;
}
//
// If input string doesn't indicate the prefix length, return 0xff.
//
Length = 0xFF;
//
// Convert the string to prefix length
//
Length = 0;
if (PrefixStr != NULL) {
Status = EFI_INVALID_PARAMETER;
Length = 0;
while (*PrefixStr != '\0') {
if (NET_IS_DIGIT (*PrefixStr)) {
Length = (UINT8) (Length * 10 + (*PrefixStr - '0'));