X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fcore%2Frtnetlink.c;h=9afe9d13d7b94ead0250ecc5a425a5f5a0553771;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=f577cba671a28444c378affd62817423dde76640;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f577cba67..9afe9d13d 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -56,12 +56,10 @@ DECLARE_MUTEX(rtnl_sem); void rtnl_lock(void) { rtnl_shlock(); - rtnl_exlock(); } void rtnl_unlock(void) { - rtnl_exunlock(); rtnl_shunlock(); netdev_run_todo(); @@ -93,7 +91,8 @@ static const int rtm_min[(RTM_MAX+1-RTM_BASE)/4] = 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] = @@ -105,7 +104,8 @@ 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) @@ -339,7 +339,6 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) struct rtnetlink_link *link_tab; struct rtattr *rta[RTATTR_MAX]; - int exclusive = 0; int sz_idx, kind; int min_len; int family; @@ -406,14 +405,6 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) 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]; @@ -441,14 +432,10 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) 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; }