[qca-nss-drv] Fix issue in dscp range check
Change-Id: Ia09d6e7ea8932ad13629f30d9a4a7fd23f57022d
Signed-off-by: Sakthi Vignesh Radhakrishnan <sradhakr@codeaurora.org>
diff --git a/nss_ipv4.c b/nss_ipv4.c
index 6126dcb..fb84ff4 100644
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -177,7 +177,7 @@
*/
enum nss_ipv4_dscp_map_actions nss_ipv4_dscp_action_get(uint8_t dscp)
{
- if (dscp > NSS_DSCP_MAP_ARRAY_SIZE) {
+ if (dscp >= NSS_DSCP_MAP_ARRAY_SIZE) {
nss_warning("dscp:%u invalid\n", dscp);
return NSS_IPV4_DSCP_MAP_ACTION_MAX;
}
diff --git a/nss_ipv6.c b/nss_ipv6.c
index b840504..dfbb908 100644
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -179,7 +179,7 @@
*/
enum nss_ipv6_dscp_map_actions nss_ipv6_dscp_action_get(uint8_t dscp)
{
- if (dscp > NSS_DSCP_MAP_ARRAY_SIZE) {
+ if (dscp >= NSS_DSCP_MAP_ARRAY_SIZE) {
nss_warning("dscp:%u invalid\n", dscp);
return NSS_IPV6_DSCP_MAP_ACTION_MAX;
}