[LARTC] deleting specific filters/classes

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 9 Apr 2002, Mihai RUSU wrote:

> Hi
>
> I have a cbq setup with all the filters in tha root class.
> If I try to delete a class with the following line:
> tc class del dev eth0 classid 1:1000
> it says:
> RTNETLINK answers: Device or resource busy
>
> Is this because I have filters (not with parent this class) with flowid
> this class?
>
> If so, then I tried to delete a specific filter. The tc filter show dev
> eth0 command shows me what I have to delete but if I try something like
> this:
>
> tc filter del dev eth0 handle 2:a5:809
> it says:
> RTNETLINK answers: No such file or directory
>
> But 2:a5:809 exists and is on dev eth0...
>
> Help ?!
>
> :)
>

Hi I have found a/the solution. Maybe it would be cool to be included in
the HOWTO.
To delete a specific filter you can use:

tc filter del dev <device> pref <priority> handle <filterhandle> <filtertype>

ex.
tc filter del dev eth0 pref 5 handle 800::801 u32

To find out the filter handle you can use tc filter show. I noticed that
this handles are structured like this:
<hashtableid>:<hashoffset>:<localoffset>

To delete a specific class first of all you have to delete all the filters
that point to that class (flowid <classid>) and also all the other classes
that are linked to this one (child classes).

Then you can use this command:
tc class del dev eth0 classid <classid>

ex.
tc class del dev eth0 classid 1:20

The only exception to this are the qdisc. They can be deleted no matter if
you have classes to a classful qdisc, filters atached to that classes
etc...

To delete a qdisc one can use:
tc qdisc del dev eth0 [parent <parentid> | root]

Its strange that it doesnt work with "handle" to specify the qdisc handle
but it works with the parent handle ;)


----------------------------
Mihai RUSU

Disclaimer: Any views or opinions presented within this e-mail are solely
those of the author and do not necessarily represent those of any company,
unless otherwise specifically stated.




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux