summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2014-02-26 21:35:11 (GMT)
committerThomas Haller <thaller@redhat.com>2014-02-27 10:32:16 (GMT)
commit20aa7320d881262c0eeeb7ca86f9162ac7694e9e (patch)
tree4358d01dce7069656880a4e5be3bb5be979cf002
parent85ec9c7ad80c60f4f619472f2bb9d9595da93b26 (diff)
downloadlibnl-20aa7320d881262c0eeeb7ca86f9162ac7694e9e.zip
libnl-20aa7320d881262c0eeeb7ca86f9162ac7694e9e.tar.gz
libnl-20aa7320d881262c0eeeb7ca86f9162ac7694e9e.tar.bz2
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>
-rw-r--r--lib/route/cls/basic.c6
1 files changed, 2 insertions, 4 deletions
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)