Subject: Re: net_sched 02/07: make cls_ops->tcf_chain() optional

From: Jarek Poplawski <[email-masked]>
Date: Sat, 05 Sep 2009 10:13:19 +0200

Patrick McHardy wrote, On 09/04/2009 06:41 PM:

> commit 6ea4233ef8f398289a14a3305d4ed440fb026d43
> Author: Patrick McHardy <[email-masked]>
> Date:   Fri Sep 4 14:28:11 2009 +0200
> 
>     net_sched: make cls_ops->tcf_chain() optional
>     
>     Some qdiscs don't support attaching filters. Handle this centrally in
>     cls_api and return a proper errno code (EOPNOTSUPP) instead of EINVAL.
>     
>     Signed-off-by: Patrick McHardy <[email-masked]>
> 
> 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.

Jarek P.