From: Cong Wang Date: Wed, 26 Feb 2014 21:35:11 +0000 (-0800) Subject: basic: make BASIC_ATTR_TARGET optional X-Git-Tag: libnl3_2_25rc1~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20aa7320d881262c0eeeb7ca86f9162ac7694e9e;p=libnl basic: make BASIC_ATTR_TARGET optional At least in kernel TCA_BASIC_CLASSID is optional. Cc: Thomas Haller Signed-off-by: Cong Wang Signed-off-by: Thomas Haller --- diff --git a/lib/route/cls/basic.c b/lib/route/cls/basic.c index c5c5cb0..5a67fae 100644 --- a/lib/route/cls/basic.c +++ b/lib/route/cls/basic.c @@ -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)