Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/ng_base.c
Show First 20 Lines • Show All 849 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
int | int | ||||
ng_name_node(node_p node, const char *name) | ng_name_node(node_p node, const char *name) | ||||
{ | { | ||||
uint32_t hash; | uint32_t hash; | ||||
node_p node2; | node_p node2; | ||||
int i; | int i; | ||||
/* Rename without change is a noop */ | |||||
if (strcmp(NG_NODE_NAME(node), name) == 0) | |||||
return (0); | |||||
/* Check the name is valid */ | /* Check the name is valid */ | ||||
for (i = 0; i < NG_NODESIZ; i++) { | for (i = 0; i < NG_NODESIZ; i++) { | ||||
if (name[i] == '\0' || name[i] == '.' || name[i] == ':') | if (name[i] == '\0' || name[i] == '.' || name[i] == ':') | ||||
break; | break; | ||||
} | } | ||||
if (i == 0 || name[i] != '\0') { | if (i == 0 || name[i] != '\0') { | ||||
TRAP_ERROR(); | TRAP_ERROR(); | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 2,996 Lines • Show Last 20 Lines |