summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-11-25 14:14:23 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-11-28 09:19:40 +0800
commit418373a1cd97abc0c0e3557f7a00105291829e6f (patch)
treed5030a527580fd78ae69c42b0fe7aba913ba9474 /MdeModulePkg/Include
parentf17e28c7911f6d2f985e7bb77e1c68cfd79bf056 (diff)
downloadedk2-platforms-418373a1cd97abc0c0e3557f7a00105291829e6f.tar.xz
MdeModulePkg/NetLib: Handle an invalid IPv6 address case
Handle an invalid IPv6 address in NetLibAsciiStrToIp6(), like '2000:aaaa::1com'. Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@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> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
Diffstat (limited to 'MdeModulePkg/Include')
-rw-r--r--MdeModulePkg/Include/Library/NetLib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Library/NetLib.h b/MdeModulePkg/Include/Library/NetLib.h
index 26709af091..09ead09497 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -523,6 +523,7 @@ extern IP4_ADDR gIp4AllMasks[IP4_MASK_NUM];
extern EFI_IPv4_ADDRESS mZeroIp4Addr;
#define NET_IS_DIGIT(Ch) (('0' <= (Ch)) && ((Ch) <= '9'))
+#define NET_IS_HEX(Ch) ((('0' <= (Ch)) && ((Ch) <= '9')) || (('A' <= (Ch)) && ((Ch) <= 'F')) || (('a' <= (Ch)) && ((Ch) <= 'f')))
#define NET_ROUNDUP(size, unit) (((size) + (unit) - 1) & (~((unit) - 1)))
#define NET_IS_LOWER_CASE_CHAR(Ch) (('a' <= (Ch)) && ((Ch) <= 'z'))
#define NET_IS_UPPER_CASE_CHAR(Ch) (('A' <= (Ch)) && ((Ch) <= 'Z'))