[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090906.020649.242756996.davem@davemloft.net>
Date: Sun, 06 Sep 2009 02:06:49 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: kaber@...sh.net
Cc: jarkao2@...il.com, netdev@...r.kernel.org
Subject: Re: net_sched 02/07: make cls_ops->tcf_chain() optional
From: Patrick McHardy <kaber@...sh.net>
Date: Sat, 05 Sep 2009 19:03:02 +0200
> Jarek Poplawski wrote:
>> Jarek Poplawski wrote, On 09/05/2009 01:57 PM:
>>
>>>>> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
>>>>> index 09cdcdf..eaa8f43 100644
>>>>> --- a/net/sched/cls_api.c
>>>>> +++ b/net/sched/cls_api.c
>>>>> @@ -181,6 +181,9 @@ replay:
>>>>> if ((cops = q->ops->cl_ops) == NULL)
>>>>> return -EINVAL;
>>>>>
>>>>> + if (cops->tcf_chain == NULL)
>>>>> + return -EOPNOTSUPP;
>>>>> +
>>>> You should probably repeat this in tc_dump_tfilter.
>>>
>>>
>>> ...In case somebody finds the way to list a filter before
>>> adding it. ;-) But, since it's quite unlikely, let's foget it.
>>
>>
>> ...or simply tries to do it instead of meditating the code.
>> So this change is definitely needed in tc_dump_tfilter too.
>
> Thanks Jarek. I'm on my way out the door, but I'll fix that tommorrow.
I'll add the following to patch 2:
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 8cbc66f..6a53694 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -433,6 +433,8 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
goto out;
if ((cops = q->ops->cl_ops) == NULL)
goto errout;
+ if (cops->tcf_chain == NULL)
+ goto errout;
if (TC_H_MIN(tcm->tcm_parent)) {
cl = cops->get(q, tcm->tcm_parent);
if (cl == 0)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists