From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCHv2 net-next 03/15] net: sched: sch_api: handle generic qdisc errors Date: Thu, 14 Dec 2017 12:56:38 -0700 Message-ID: References: <20171214183905.23066-1-aring@mojatatu.com> <20171214183905.23066-4-aring@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, netdev@vger.kernel.org, kernel@mojatatu.com, David Ahern To: Alexander Aring , jhs@mojatatu.com Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:42314 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbdLNT4k (ORCPT ); Thu, 14 Dec 2017 14:56:40 -0500 Received: by mail-pf0-f193.google.com with SMTP id d23so4379635pfe.9 for ; Thu, 14 Dec 2017 11:56:40 -0800 (PST) In-Reply-To: <20171214183905.23066-4-aring@mojatatu.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/14/17 11:38 AM, Alexander Aring wrote: > @@ -912,8 +920,10 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, > (new && new->flags & TCQ_F_INGRESS)) { > num_q = 1; > ingress = 1; > - if (!dev_ingress_queue(dev)) > + if (!dev_ingress_queue(dev)) { > + NL_SET_ERR_MSG(extack, "Cannot find ingress queue for specified device"); "Device does not have an ingress queue" ? > @@ -1241,8 +1262,10 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, > int err; > > if ((n->nlmsg_type != RTM_GETQDISC) && > - !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) > + !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) { > + NL_SET_ERR_MSG(extack, "Net admin permission required for this operation"); EPERM does not need a string. > @@ -1309,8 +1346,10 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, > struct Qdisc *q, *p; > int err; > > - if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) > + if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) { > + NL_SET_ERR_MSG(extack, "Net admin permission required for this operation"); Ditto here. Please check other patches as well. > return -EPERM; > + } > > replay: > /* Reinit, just in case something touches this. */