From c720da286687aed978d9a20bcdd6d303bade9ddc Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Fri, 8 Apr 2016 09:44:09 +0800 Subject: NetworkPkg: Add new macros and refine codes v2: *refine some codes Add 2 macros in NetLib.h #define IP4_MASK_MAX 32 #define IP6_PREFIX_MAX 128 we will use these two macros to check the max mask/prefix length, instead of #define IP4_MASK_NUM 33 #define IP6_PREFIX_NUM 129 which means a valid number This will make the code readability and maintainability. Cc: Subramanian Sriram Cc: Fu Siyuan Cc: Ye Ting Cc: Wu Jiaxin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Reviewed-by: Sriram Subramanian --- NetworkPkg/Ip6Dxe/Ip6Impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'NetworkPkg/Ip6Dxe/Ip6Impl.c') diff --git a/NetworkPkg/Ip6Dxe/Ip6Impl.c b/NetworkPkg/Ip6Dxe/Ip6Impl.c index b186c0af20..c937423428 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Impl.c +++ b/NetworkPkg/Ip6Dxe/Ip6Impl.c @@ -2,7 +2,7 @@ Implementation of EFI_IP6_PROTOCOL protocol interfaces. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -842,7 +842,7 @@ EfiIp6Routes ( EFI_TPL OldTpl; IP6_SERVICE *IpSb; - if ((This == NULL) || (PrefixLength >= IP6_PREFIX_NUM)) { + if ((This == NULL) || (PrefixLength > IP6_PREFIX_MAX)) { return EFI_INVALID_PARAMETER; } -- cgit v1.2.3