Skip to content

Commit

Permalink
qinq vlan parsing fix in case of offload
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Nov 20, 2017
1 parent 8872bb6 commit 83595f3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions kernel/pf_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,10 +2201,19 @@ static int parse_pkt(struct sk_buff *skb,

rc = parse_raw_pkt(buffer, data_len, hdr, ip_id);

if (!hdr->extended_hdr.parsed_pkt.vlan_id) {
if((hdr->extended_hdr.parsed_pkt.vlan_id == 0)
|| (hdr->extended_hdr.parsed_pkt.qinq_vlan_id == 0)) {
/* check for stripped vlan id */
if (__vlan_hwaccel_get_tag(skb, &hdr->extended_hdr.parsed_pkt.vlan_id) == 0) {
hdr->extended_hdr.parsed_pkt.vlan_id &= VLAN_VID_MASK;
u_int16_t vlan_id;

if(__vlan_hwaccel_get_tag(skb, &vlan_id) == 0) {
vlan_id &= VLAN_VID_MASK;

if(hdr->extended_hdr.parsed_pkt.vlan_id != 0)
hdr->extended_hdr.parsed_pkt.qinq_vlan_id = hdr->extended_hdr.parsed_pkt.vlan_id;

hdr->extended_hdr.parsed_pkt.vlan_id = vlan_id;

hash_pkt_header(hdr, HASH_PKT_HDR_RECOMPUTE); /* force hash recomputation */
}
}
Expand Down

0 comments on commit 83595f3

Please sign in to comment.