]> git.baikalelectronics.ru Git - kernel.git/commit
tun: export underlying socket
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 14 Jan 2010 06:17:09 +0000 (06:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jan 2010 09:43:28 +0000 (01:43 -0800)
commit9bad25d881e07937d5a4ded783d88cd4b97a3872
tree4db94de98ef8e75d5038f6a889dd434f3747c9d3
parent9f21b8496290af52dbaba7ccf0642c0dde3eed7a
tun: export underlying socket

Tun device looks similar to a packet socket
in that both pass complete frames from/to userspace.

This patch fills in enough fields in the socket underlying tun driver
to support sendmsg/recvmsg operations, and message flags
MSG_TRUNC and MSG_DONTWAIT, and exports access to this socket
to modules.  Regular read/write behaviour is unchanged.

This way, code using raw sockets to inject packets
into a physical device, can support injecting
packets into host network stack almost without modification.

First user of this interface will be vhost virtualization
accelerator.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c
include/linux/if_tun.h