* here. (eg. NLA_F_NESTED)
*/
const int ao_fill_pi_flags;
+
+ /** IFLA_AF_SPEC nesting override
+ *
+ * Called if a link message is sent to the kernel. If this is set,
+ * the AF specific nest is not created. Instead, AF specific attributes
+ * are nested directly in the IFLA_AF_SPEC attribute.
+ */
+ const int ao_fill_af_no_nest;
};
extern struct rtnl_link_af_ops *rtnl_link_af_ops_lookup(unsigned int);
void *data, void *arg)
{
struct nl_msg *msg = arg;
- struct nlattr *af_attr;
+ struct nlattr *af_attr = NULL;
int err;
if (!ops->ao_fill_af)
return 0;
- if (!(af_attr = nla_nest_start(msg, ops->ao_family)))
- return -NLE_MSGSIZE;
+ if (!ops->ao_fill_af_no_nest)
+ if (!(af_attr = nla_nest_start(msg, ops->ao_family)))
+ return -NLE_MSGSIZE;
if ((err = ops->ao_fill_af(link, arg, data)) < 0)
return err;
- nla_nest_end(msg, af_attr);
+ if (!ops->ao_fill_af_no_nest)
+ nla_nest_end(msg, af_attr);
return 0;
}