basic: Only add ematches to message if available
This commit is contained in:
parent
d7a561a137
commit
2f867686ac
1 changed files with 5 additions and 1 deletions
|
@ -121,7 +121,11 @@ static int basic_get_opts(struct rtnl_cls *cls, struct nl_msg *msg)
|
|||
|
||||
NLA_PUT_U32(msg, TCA_BASIC_CLASSID, b->b_target);
|
||||
|
||||
return rtnl_ematch_fill_attr(msg, TCA_BASIC_EMATCHES, b->b_ematch);
|
||||
if (b->b_mask & BASIC_ATTR_EMATCH &&
|
||||
rtnl_ematch_fill_attr(msg, TCA_BASIC_EMATCHES, b->b_ematch) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
return 0;
|
||||
|
||||
nla_put_failure:
|
||||
return -NLE_NOMEM;
|
||||
|
|
Loading…
Add table
Reference in a new issue