mirror of
https://github.com/opnsense/src.git
synced 2026-04-23 23:28:37 -04:00
netgraph/ng_base: Renaming a node to the same name is a noop
Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong MFC: 1 week Differential Revision: https://reviews.freebsd.org/D30110
This commit is contained in:
parent
9b236631b1
commit
0345fd891f
1 changed files with 4 additions and 0 deletions
|
|
@ -855,6 +855,10 @@ ng_name_node(node_p node, const char *name)
|
|||
node_p node2;
|
||||
int i;
|
||||
|
||||
/* Rename without change is a noop */
|
||||
if (strcmp(NG_NODE_NAME(node), name) == 0)
|
||||
return (0);
|
||||
|
||||
/* Check the name is valid */
|
||||
for (i = 0; i < NG_NODESIZ; i++) {
|
||||
if (name[i] == '\0' || name[i] == '.' || name[i] == ':')
|
||||
|
|
|
|||
Loading…
Reference in a new issue