- const struct iphdr *ip = (void *)(eth + 1);
- switch (ip->protocol) {
- case IPPROTO_UDP: {
- const struct udphdr *udp = (void *)(ip + 1);
- if (udp->dest != ntohs(4789)) { /* VxLAN dest port */
- DEBUG_PRINT("unsupported udp dst port %x", (int)udp->dest);
- return XDP_PASS;
- }
- }
- case IPPROTO_IPIP:
- case IPPROTO_ESP:
- break;
- default:
- DEBUG_PRINT("unsupported ip proto %x", (int)ip->protocol);
- return XDP_PASS;
+ const struct ethhdr *eth = data;
+ if (eth->h_proto != ntohs (ETH_P_IP))
+ {
+ DEBUG_PRINT ("unsupported eth proto %x", (int) eth->h_proto);
+ return XDP_PASS;