From ea0eec9d3004078b1bdb2b03ee7b0f65a1bdde91 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Tue, 3 Dec 2013 20:16:11 -0800 Subject: [PATCH] add an assertion in rtnl_tc_set_link() So that we can catch the bug easily. Signed-off-by: Cong Wang Signed-off-by: Thomas Graf --- lib/route/tc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/route/tc.c b/lib/route/tc.c index fbc5c7ea8..0886e8e49 100644 --- a/lib/route/tc.c +++ b/lib/route/tc.c @@ -300,6 +300,8 @@ void rtnl_tc_set_link(struct rtnl_tc *tc, struct rtnl_link *link) if (!link) return; + if (!link->l_index) + BUG(); nl_object_get(OBJ_CAST(link)); tc->tc_link = link;