Commit f3fd8e30 authored by yonghong-song's avatar yonghong-song Committed by GitHub

Revert "Remove duplicate code from xdp_drop_count.py (#2049)" (#2069)

This reverts commit 5b76047f.

The code is actually not duplicated. It is used to process
double vlan's. See comments in:
  https://github.com/iovisor/bcc/pull/1493
parent 1f6ef8ce
......@@ -96,6 +96,15 @@ int xdp_prog1(struct CTXTYPE *ctx) {
h_proto = eth->h_proto;
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
vhdr = data + nh_off;
nh_off += sizeof(struct vlan_hdr);
if (data + nh_off > data_end)
return rc;
h_proto = vhdr->h_vlan_encapsulated_proto;
}
if (h_proto == htons(ETH_P_8021Q) || h_proto == htons(ETH_P_8021AD)) {
struct vlan_hdr *vhdr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment