veth
struct vlan_ethhdr *veth = skb_vlan_eth_hdr(skb);
__be16 vlan_proto = veth->h_vlan_proto;
vlanid = ntohs(veth->h_vlan_TCI);
memmove(skb->data + VLAN_HLEN, veth, ETH_ALEN * 2);
struct vlan_ethhdr *veth;
veth = skb_push(skb, VLAN_HLEN);
veth->h_vlan_proto = cpu_to_be16(ETH_P_8021Q);
veth->h_vlan_TCI = htons(tag);
} veth;
veth.h_vlan_proto = skb->vlan_proto;
veth.h_vlan_TCI = htons(skb_vlan_tag_get(skb));
ret = copy_to_iter(&veth, sizeof(veth), iter);
if (ret != sizeof(veth) || !iov_iter_count(iter))
struct veth veth;
veth.h_vlan_proto = skb->vlan_proto;
veth.h_vlan_TCI = htons(skb_vlan_tag_get(skb));
ret = copy_to_iter(&veth, sizeof(veth), iter);
if (ret != sizeof(veth) || !iov_iter_count(iter))
struct vlan_ethhdr *veth;
hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IP));
hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IPV6));
struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
if (veth->h_vlan_proto == htons(ETH_P_8021Q))
return ~ntohs(veth->h_vlan_TCI) >>
struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
if (veth->h_vlan_proto == htons(ETH_P_8021Q)) {
hdr->hdr.l2.vlan_id = ntohs(veth->h_vlan_TCI);
struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
} else if (veth->h_vlan_proto == htons(ETH_P_8021Q)) {
hdr->hdr.l3.vlan_id = ntohs(veth->h_vlan_TCI);
struct vlan_ethhdr *veth;
veth = (struct vlan_ethhdr *)(skb->data + mac_len - ETH_HLEN);
veth->h_vlan_proto = vlan_proto;
veth->h_vlan_encapsulated_proto = skb->protocol;
veth->h_vlan_TCI = htons(vlan_tci);
struct vlan_ethhdr *veth = skb_vlan_eth_hdr(skb);
if (!eth_type_vlan(veth->h_vlan_proto))
*vlan_tci = ntohs(veth->h_vlan_TCI);
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
veth->h_vlan_proto != vlan->vlan_proto) {
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
return __vlan_get_protocol(skb, veth->h_vlan_proto, NULL);
struct vlan_ethhdr *veth;
if (!pskb_may_pull(skb, skb_mac_offset(skb) + sizeof(*veth)))
veth = (struct vlan_ethhdr *)skb_mac_header(skb);
proto = veth->h_vlan_encapsulated_proto;
struct vlan_ethhdr *veth;
veth = (struct vlan_ethhdr *)skb_mac_header(skb);
tuple->encap[i].id = ntohs(veth->h_vlan_TCI);
inner_proto = veth->h_vlan_encapsulated_proto;
struct vlan_ethhdr *veth;
if (!pskb_may_pull(skb, skb_mac_offset(skb) + sizeof(*veth)))
veth = (struct vlan_ethhdr *)skb_mac_header(skb);
if (veth->h_vlan_encapsulated_proto == proto) {
struct vlan_ethhdr veth;
BUILD_BUG_ON(sizeof(veth) > NFT_TRACETYPE_LL_HSIZE);
if (skb_copy_bits(skb, off, &veth, ETH_HLEN))
veth.h_vlan_proto = skb->vlan_proto;
veth.h_vlan_TCI = htons(skb_vlan_tag_get(skb));
veth.h_vlan_encapsulated_proto = skb->protocol;
return nla_put(nlskb, NFTA_TRACE_LL_HEADER, sizeof(veth), &veth);
struct vlan_ethhdr *veth, _veth;
veth = skb_header_pointer(pkt->skb, off, sizeof(_veth), &_veth);
if (!veth)
outer_llproto = veth->h_vlan_encapsulated_proto;
llproto = veth->h_vlan_proto;
struct vlan_ethhdr *veth)
if (skb_copy_bits(skb, mac_off, veth, ETH_HLEN))
veth->h_vlan_proto = skb->vlan_proto;
veth->h_vlan_TCI = htons(skb_vlan_tag_get(skb));
veth->h_vlan_encapsulated_proto = skb->protocol;
struct vlan_ethhdr veth;
vlanh = (u8 *) &veth;
if (!nft_payload_rebuild_vlan_hdr(skb, mac_off, &veth))
strscpy(skel->rodata->veth, "binddevtest1");
int veth, bond, err;
veth = if_nametoindex("veth");
if (!ASSERT_GE(veth, 0, "if_nametoindex veth"))
link = bpf_program__attach_xdp(skeletons->xdp_dummy->progs.xdp_dummy_prog, veth);
link = bpf_program__attach_xdp(skeletons->xdp_dummy->progs.xdp_dummy_prog, veth);
link2 = bpf_program__attach_xdp(skeletons->xdp_dummy->progs.xdp_dummy_prog, veth);
const volatile char veth[IFNAMSIZ];
(void *)veth, sizeof(veth)))
static int start_child(unsigned int nr, char *veth, int test_desc_fd[2])
if (init_child(nsfd_childa, veth, child_ip(nr), grchild_ip(nr)))
if (init_child(nsfd_childb, veth, grchild_ip(nr), child_ip(nr)))
char veth[VETH_LEN];
snprintf(veth, VETH_LEN, VETH_FMT, i);
if (veth_add(route_sock, route_seq++, veth, nsfd_childa, veth, nsfd_childb)) {
if (start_child(i, veth, test_desc_fd)) {
static int tunnel_set_route(int route_sock, uint32_t *route_seq, char *veth,
if (ip4_route_set(route_sock, (*route_seq)++, veth, tunsrc, tundst)) {
static int init_child(int nsfd, char *veth, unsigned int src, unsigned int dst)
if (ip4_addr_set(route_sock, route_seq++, veth, intsrc, PREFIX_LEN)) {
if (link_set_up(route_sock, route_seq++, veth)) {
printk("Failed to bring up %s", veth);
if (tunnel_set_route(route_sock, &route_seq, veth, tunsrc, tundst)) {
printk("Failed to add tunnel route on %s", veth);
static void link_init(const char *veth, int family, uint8_t prefix,
if (link_set_up(veth))
if (ip_addr_add(veth, family, addr, prefix))
if (ip_route_add(veth, family, addr, dest))