tun.c (1a097910adda6b3328fc235575bba0e9ee408492) tun.c (fe8dd45bb7556246c6b76277b1ba4296c91c2505)
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 2417 unchanged lines hidden (view full) ---

2426 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT);
2427}
2428
2429static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
2430{
2431 int ret;
2432 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2433 struct tun_struct *tun = tun_get(tfile);
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 2417 unchanged lines hidden (view full) ---

2426 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT);
2427}
2428
2429static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
2430{
2431 int ret;
2432 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2433 struct tun_struct *tun = tun_get(tfile);
2434 struct tun_msg_ctl *ctl = m->msg_control;
2434
2435 if (!tun)
2436 return -EBADFD;
2437
2435
2436 if (!tun)
2437 return -EBADFD;
2438
2438 ret = tun_get_user(tun, tfile, m->msg_control, &m->msg_iter,
2439 if (ctl && ctl->type != TUN_MSG_UBUF)
2440 return -EINVAL;
2441
2442 ret = tun_get_user(tun, tfile, ctl ? ctl->ptr : NULL, &m->msg_iter,
2439 m->msg_flags & MSG_DONTWAIT,
2440 m->msg_flags & MSG_MORE);
2441 tun_put(tun);
2442 return ret;
2443}
2444
2445static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
2446 int flags)

--- 1142 unchanged lines hidden ---
2443 m->msg_flags & MSG_DONTWAIT,
2444 m->msg_flags & MSG_MORE);
2445 tun_put(tun);
2446 return ret;
2447}
2448
2449static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
2450 int flags)

--- 1142 unchanged lines hidden ---