[PATCH 1/3] basic: make BASIC_ATTR_TARGET optional

Cong Wang xiyou.wangcong at gmail.com
Wed Feb 26 16:35:11 EST 2014


At least in kernel TCA_BASIC_CLASSID is optional.

Cc: Thomas Haller <thaller at redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
 lib/route/cls/basic.c | 6 ++----
 1 file 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)
-- 
1.8.3.1




More information about the libnl mailing list