Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
649ba15
)
vlib: fix call to vlib_get_node_by_name
01/28801/2
author
Benoît Ganne
<bganne@cisco.com>
Thu, 10 Sep 2020 12:12:06 +0000
(14:12 +0200)
committer
Andrew Yourtchenko
<ayourtch@gmail.com>
Tue, 15 Sep 2020 08:38:32 +0000
(08:38 +0000)
Type: fix
Change-Id: I1b4f52e186165b04db5bd5f11058dc77b647bc94
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit
268e3b647733807dbecf402fcebedceff4c85544
)
src/vlib/node.c
patch
|
blob
|
history
diff --git
a/src/vlib/node.c
b/src/vlib/node.c
index
119b471
..
169c67b
100644
(file)
--- a/
src/vlib/node.c
+++ b/
src/vlib/node.c
@@
-347,7
+347,10
@@
register_node (vlib_main_t * vm, vlib_node_registration_t * r)
/* Node names must be unique. */
{
- vlib_node_t *o = vlib_get_node_by_name (vm, n->name);
+ /* vlib_get_node_by_name() expects NULL-terminated strings */
+ u8 *name = format (0, "%v%c", n->name, 0);
+ vlib_node_t *o = vlib_get_node_by_name (vm, name);
+ vec_free (name);
if (o)
clib_error ("more than one node named `%v'", n->name);
}