Permalink
Browse files

basic: make BASIC_ATTR_TARGET optional

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>
  • Loading branch information...
1 parent 85ec9c7 commit 20aa7320d881262c0eeeb7ca86f9162ac7694e9e @congwang congwang committed with Feb 26, 2014
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/route/cls/basic.c
View
@@ -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)

0 comments on commit 20aa732

Please sign in to comment.