Here is the INSERT_BEFORE macro in util_filter.c:

#define INSERT_BEFORE(f, before_this) ((before_this) == NULL \

                           || (before_this)->frec->ftype > (f)->frec->ftype \
                           || (before_this)->r != (f)->r)


While it does the right thing for output filters, for
input filters it's broken: the ftype check should be ">="


(before_this)->frec->ftype >= (f)->frec->ftype

The reason this sucks now is because whenever I have to develop
input filter code where more than one addition of a filter
is involved, the current code screws up the chronological ordering
of how the filters get added- it puts newer additions further past
older ones up the chain, which I always have to fix with some crufty
filter relocation code.


I don't know how to easily patch this because most of the filtering
logic is based around doing the same thing for output filters and
input filters, but this pain has been around for a long time now
and I don't know if anyone has raised the issue before.

Reply via email to