Le mardi 18 janvier 2011 à 16:39 +0000, Ian Molton a écrit :
From: Alban Crequy <redacted>
Linux Socket Filters can already be successfully attached and detached on unix
sockets with setsockopt(sockfd, SOL_SOCKET, SO_{ATTACH,DETACH}_FILTER, ...).
See: Documentation/networking/filter.txt
But the filter was never used in the unix socket code so it did not work. This
patch uses sk_filter() to filter buffers before delivery.
This short program demonstrates the problem on SOCK_DGRAM.
Any idea on performance cost adding sk_filter() call ?
Hmm, looking at it, I have no idea why sk_filter() needs to block BH.
I'll send a patch to relax this requirement.