void rtnl_lock(void)
{
rtnl_shlock();
- rtnl_exlock();
}
void rtnl_unlock(void)
{
- rtnl_exunlock();
rtnl_shunlock();
netdev_run_todo();
NLMSG_LENGTH(sizeof(struct rtmsg)),
NLMSG_LENGTH(sizeof(struct tcmsg)),
NLMSG_LENGTH(sizeof(struct tcmsg)),
- NLMSG_LENGTH(sizeof(struct tcmsg))
+ NLMSG_LENGTH(sizeof(struct tcmsg)),
+ NLMSG_LENGTH(sizeof(struct tcamsg))
};
static const int rta_max[(RTM_MAX+1-RTM_BASE)/4] =
RTA_MAX,
TCA_MAX,
TCA_MAX,
- TCA_MAX
+ TCA_MAX,
+ TCAA_MAX
};
void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
struct rtnetlink_link *link_tab;
struct rtattr *rta[RTATTR_MAX];
- int exclusive = 0;
int sz_idx, kind;
int min_len;
int family;
return -1;
}
- if (kind != 2) {
- if (rtnl_exlock_nowait()) {
- *errp = 0;
- return -1;
- }
- exclusive = 1;
- }
-
memset(&rta, 0, sizeof(rta));
min_len = rtm_min[sz_idx];
goto err_inval;
err = link->doit(skb, nlh, (void *)&rta);
- if (exclusive)
- rtnl_exunlock();
*errp = err;
return err;
err_inval:
- if (exclusive)
- rtnl_exunlock();
*errp = -EINVAL;
return -1;
}