This patch is used to allow the IPv4 with prefix case.
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
TempStr = Ip4Str;\r
\r
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {\r
- if (!NET_IS_DIGIT (*Ip4Str)) {\r
+ if (Index != 3 && !NET_IS_DIGIT (*Ip4Str)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+ \r
+ //\r
+ // Allow the IPv4 with prefix case, e.g. 192.168.10.10/24 \r
+ //\r
+ if (Index == 3 && !NET_IS_DIGIT (*Ip4Str) && *Ip4Str != '/') {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
Ip4Str++;\r
}\r
\r