git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc783e7
)
lpm: fix overflow issue
author
Igor Ryzhov
<iryzhov@nfware.com>
Fri, 20 Feb 2015 13:16:46 +0000
(16:16 +0300)
committer
Thomas Monjalon
<thomas.monjalon@6wind.com>
Tue, 24 Feb 2015 01:08:19 +0000
(
02:08
+0100)
LPM table overflow may occur if table is full and added rule has
the biggest depth that already have some rules.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_lpm/rte_lpm.c
patch
|
blob
|
history
diff --git
a/lib/librte_lpm/rte_lpm.c
b/lib/librte_lpm/rte_lpm.c
index
983e04b
..
cc51210
100644
(file)
--- a/
lib/librte_lpm/rte_lpm.c
+++ b/
lib/librte_lpm/rte_lpm.c
@@
-298,6
+298,9
@@
rule_add(struct rte_lpm *lpm, uint32_t ip_masked, uint8_t depth,
return rule_index;
}
}
+
+ if (rule_index == lpm->max_rules)
+ return -ENOSPC;
} else {
/* Calculate the position in which the rule will be stored. */
rule_index = 0;