File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -909,10 +909,14 @@ protocol_filter(const void *data, uint16_t len)
909909 const struct vlan_hdr * vlanhdr ;
910910 hdr = (const struct ether_hdr * )data ;
911911 uint16_t ether_type = rte_be_to_cpu_16 (hdr -> ether_type );
912+ data += ETHER_HDR_LEN ;
913+ len -= ETHER_HDR_LEN ;
912914
913915 if (ether_type == ETHER_TYPE_VLAN ) {
914- vlanhdr = (struct vlan_hdr * )( data + sizeof ( struct ether_hdr )) ;
916+ vlanhdr = (struct vlan_hdr * )data ;
915917 ether_type = rte_be_to_cpu_16 (vlanhdr -> eth_proto );
918+ data += sizeof (struct vlan_hdr );
919+ len -= sizeof (struct vlan_hdr );
916920 }
917921
918922 if (ether_type == ETHER_TYPE_ARP )
@@ -928,8 +932,7 @@ protocol_filter(const void *data, uint16_t len)
928932 if (ether_type != ETHER_TYPE_IPv4 )
929933 return FILTER_UNKNOWN ;
930934
931- return ff_kni_proto_filter (data + ETHER_HDR_LEN ,
932- len - ETHER_HDR_LEN );
935+ return ff_kni_proto_filter (data , len );
933936#endif
934937}
935938
You can’t perform that action at this time.
0 commit comments