aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2017-05-17 12:14:41 +0800
committerDavid S. Miller <davem@davemloft.net>2017-05-18 10:07:40 -0400
commit83339c6b159ea6429a1db40b0d9d1083ab574733 (patch)
tree7d926f806685e9dedd488e93f68a9696d48bbe4d /drivers/net/tun.c
parentskb_array: introduce batch dequeuing (diff)
downloadlinux-dev-83339c6b159ea6429a1db40b0d9d1083ab574733.tar.xz
linux-dev-83339c6b159ea6429a1db40b0d9d1083ab574733.zip
tun: export skb_array
This patch exports skb_array through tun_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index bbd707b9ef7a..3cbfc5c707e3 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2626,6 +2626,19 @@ struct socket *tun_get_socket(struct file *file)
}
EXPORT_SYMBOL_GPL(tun_get_socket);
+struct skb_array *tun_get_skb_array(struct file *file)
+{
+ struct tun_file *tfile;
+
+ if (file->f_op != &tun_fops)
+ return ERR_PTR(-EINVAL);
+ tfile = file->private_data;
+ if (!tfile)
+ return ERR_PTR(-EBADFD);
+ return &tfile->tx_array;
+}
+EXPORT_SYMBOL_GPL(tun_get_skb_array);
+
module_init(tun_init);
module_exit(tun_cleanup);
MODULE_DESCRIPTION(DRV_DESCRIPTION);