Re: [PATCH net v3 5/9] tun: Decouple vnet handling
From: Willem de Bruijn
Date: Fri Jan 17 2025 - 04:18:31 EST
Akihiko Odaki wrote:
> Decouple the vnet handling code so that we can reuse it for tap.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>
> ---
> drivers/net/tun.c | 229 +++++++++++++++++++++++++++++++-----------------------
> 1 file changed, 133 insertions(+), 96 deletions(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index add09dfdada5..1f4a066ad2f0 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -351,6 +351,122 @@ static inline __virtio16 cpu_to_tun16(unsigned int flags, u16 val)
> return __cpu_to_virtio16(tun_is_little_endian(flags), val);
> }
>
> +static long tun_vnet_ioctl(int *sz, unsigned int *flags,
> + unsigned int cmd, int __user *sp)
> +{
please use vnet_hdr_len_sz instead of sz. It's a bit too cryptic for
a casual reader to understand the meaning.