tap.c (d0034a7a4ac7fae708146ac0059b9c47a1543f0d) tap.c (74a335a07a17d131b9263bfdbdcb5e40673ca9ca)
1// SPDX-License-Identifier: GPL-2.0-only
2#include <linux/etherdevice.h>
3#include <linux/if_tap.h>
4#include <linux/if_vlan.h>
5#include <linux/interrupt.h>
6#include <linux/nsproxy.h>
7#include <linux/compat.h>
8#include <linux/if_tun.h>

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

1193static int tap_sendmsg(struct socket *sock, struct msghdr *m,
1194 size_t total_len)
1195{
1196 struct tap_queue *q = container_of(sock, struct tap_queue, sock);
1197 struct tun_msg_ctl *ctl = m->msg_control;
1198 struct xdp_buff *xdp;
1199 int i;
1200
1// SPDX-License-Identifier: GPL-2.0-only
2#include <linux/etherdevice.h>
3#include <linux/if_tap.h>
4#include <linux/if_vlan.h>
5#include <linux/interrupt.h>
6#include <linux/nsproxy.h>
7#include <linux/compat.h>
8#include <linux/if_tun.h>

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

1193static int tap_sendmsg(struct socket *sock, struct msghdr *m,
1194 size_t total_len)
1195{
1196 struct tap_queue *q = container_of(sock, struct tap_queue, sock);
1197 struct tun_msg_ctl *ctl = m->msg_control;
1198 struct xdp_buff *xdp;
1199 int i;
1200
1201 if (ctl && (ctl->type == TUN_MSG_PTR)) {
1201 if (m->msg_controllen == sizeof(struct tun_msg_ctl) &&
1202 ctl && ctl->type == TUN_MSG_PTR) {
1202 for (i = 0; i < ctl->num; i++) {
1203 xdp = &((struct xdp_buff *)ctl->ptr)[i];
1204 tap_get_user_xdp(q, xdp);
1205 }
1206 return 0;
1207 }
1208
1209 return tap_get_user(q, ctl ? ctl->ptr : NULL, &m->msg_iter,

--- 156 unchanged lines hidden ---
1203 for (i = 0; i < ctl->num; i++) {
1204 xdp = &((struct xdp_buff *)ctl->ptr)[i];
1205 tap_get_user_xdp(q, xdp);
1206 }
1207 return 0;
1208 }
1209
1210 return tap_get_user(q, ctl ? ctl->ptr : NULL, &m->msg_iter,

--- 156 unchanged lines hidden ---