]> granicus.if.org Git - libnl/commitdiff
basic: make BASIC_ATTR_TARGET optional
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 26 Feb 2014 21:35:11 +0000 (13:35 -0800)
committerThomas Haller <thaller@redhat.com>
Thu, 27 Feb 2014 10:32:16 +0000 (11:32 +0100)
At least in kernel TCA_BASIC_CLASSID is optional.

Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/route/cls/basic.c

index c5c5cb076e0025dbf01b832792a66fc2821fbfe8..5a67fae908e6d156f9c8b8d88e448aa2954cc1f7 100644 (file)
@@ -142,10 +142,8 @@ static int basic_msg_fill(struct rtnl_tc *tc, void *data,
        if (!b)
                return 0;
 
-       if (!(b->b_mask & BASIC_ATTR_TARGET))
-               return -NLE_MISSING_ATTR;
-
-       NLA_PUT_U32(msg, TCA_BASIC_CLASSID, b->b_target);
+       if (b->b_mask & BASIC_ATTR_TARGET)
+               NLA_PUT_U32(msg, TCA_BASIC_CLASSID, b->b_target);
 
        if (b->b_mask & BASIC_ATTR_EMATCH &&
            rtnl_ematch_fill_attr(msg, TCA_BASIC_EMATCHES, b->b_ematch) < 0)