From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: socket filter Date: Thu, 19 Aug 2010 22:04:31 -0700 Message-ID: <20100819220431.381da765@nehalam> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netfilter-devel@vger.kernel.org To: krunal patel Return-path: Received: from mail.vyatta.com ([76.74.103.46]:33879 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172Ab0HTFEd (ORCPT ); Fri, 20 Aug 2010 01:04:33 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Fri, 20 Aug 2010 09:57:33 +0530 krunal patel wrote: > Hi, > > There are ioctl's for attaching bpf like filters to socket. I found it > in kernel documentation. > setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &Filter, sizeof(Filter)); > I doubt is can we attach filters in case of netlink socket. > I am logging all packets using ULOG target and using ulogd. > Is it possible to use same ioctl for netlink socket we create in ulogd? You can use socket filters on netlink sockets since 2.6.26