From: Patrick McHardy <kaber@trash.net>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>,
Paul Moore <paul.moore@hp.com>,
David Woodhouse <David.Woodhouse@intel.com>,
Sridhar Samudrala <sri@us.ibm.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tun: socket filter support
Date: Mon, 15 Feb 2010 16:24:43 +0100 [thread overview]
Message-ID: <4B79673B.7050908@trash.net> (raw)
In-Reply-To: <20100214110110.GC30182@redhat.com>
Michael S. Tsirkin wrote:
> + case TUNATTACHFILTER:
> + /* Can be set only for TAPs */
> + ret = -EINVAL;
> + if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
> + break;
> + ret = -EFAULT;
> + if (copy_from_user(&fprog, argp, sizeof(fprog)))
> + break;
> +
> + ret = sk_attach_filter(&fprog, tun->socket.sk);
> + break;
> +
> + case TUNDETACHFILTER:
> + /* Can be set only for TAPs */
> + ret = -EINVAL;
> + if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
> + break;
> + ret = sk_detach_filter(tun->socket.sk);
> + break;
> +
I'm not sure how the tun socket is exposed, but won't the regular
SO_ATTACH_FILTER/SO_DETACH_FILTER setsockopts already work for
tun sockets?
next prev parent reply other threads:[~2010-02-15 15:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1266144917.git.mst@redhat.com>
2010-02-14 11:01 ` [PATCH 1/2] net: export attach/detach filter routines Michael S. Tsirkin
2010-02-14 11:01 ` [PATCH 2/2] tun: socket filter support Michael S. Tsirkin
2010-02-15 15:24 ` Patrick McHardy [this message]
2010-02-15 15:45 ` Arnd Bergmann
2010-02-15 15:46 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B79673B.7050908@trash.net \
--to=kaber@trash.net \
--cc=David.Woodhouse@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=paul.moore@hp.com \
--cc=sri@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox