]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
add an assertion in rtnl_tc_set_link()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 4 Dec 2013 04:16:11 +0000 (20:16 -0800)
committerThomas Graf <tgraf@suug.ch>
Wed, 11 Dec 2013 08:08:23 +0000 (09:08 +0100)
So that we can catch the bug easily.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/route/tc.c

index fbc5c7ea82b61e0638727a52e9db0c875fcb71fb..0886e8e493f4791178151055b63ecaab949e2998 100644 (file)
@@ -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;