Skip to content

Commit

Permalink
Remove duplicate code from xdp_drop_count.py (iovisor#2049)
Browse files Browse the repository at this point in the history
Also, fix an incorrect indentation in the same block.
  • Loading branch information
sevagh authored and yonghong-song committed Nov 20, 2018
1 parent 62bc225 commit 5b76047
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions examples/networking/xdp/xdp_drop_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,7 @@ def usage():
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;
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;
h_proto = vhdr->h_vlan_encapsulated_proto;
}
if (h_proto == htons(ETH_P_IP))
Expand Down

0 comments on commit 5b76047

Please sign in to comment.