netlink: BUG() if we don't have parent information
This would indicate that we hang a TC object to the tree root. Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
f9c714fa15
commit
a0eea59519
@ -545,11 +545,14 @@ static struct element *handle_tc_obj(struct rtnl_tc *tc, const char *prefix,
|
||||
snprintf(name, sizeof(name), "%s %s (%s)",
|
||||
prefix, buf, rtnl_tc_get_kind(tc));
|
||||
|
||||
if (!(e = element_lookup(grp, name, id, rdata ? rdata->parent : NULL, ELEMENT_CREAT)))
|
||||
if (!rdata || !rdata->parent)
|
||||
BUG();
|
||||
|
||||
if (!(e = element_lookup(grp, name, id, rdata->parent, ELEMENT_CREAT)))
|
||||
return NULL;
|
||||
|
||||
if (e->e_flags & ELEMENT_FLAG_CREATED) {
|
||||
e->e_level = rdata ? rdata->level : 0;
|
||||
e->e_level = rdata->level;
|
||||
|
||||
if (element_set_key_attr(e, "tc_bytes", "tc_packets") ||
|
||||
element_set_usage_attr(e, "tc_bytes"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user