[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B79673B.7050908@trash.net>
Date: Mon, 15 Feb 2010 16:24:43 +0100
From: Patrick McHardy <kaber@...sh.net>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: "David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
Paul Moore <paul.moore@...com>,
David Woodhouse <David.Woodhouse@...el.com>,
Sridhar Samudrala <sri@...ibm.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] tun: socket filter support
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?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists