summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ring.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/ring.h b/ring.h
index 56c305d..a195f74 100644
--- a/ring.h
+++ b/ring.h
@@ -67,14 +67,13 @@ static inline uint16_t tpacket_uhdr_vlan_proto(union tpacket_uhdr *hdr, bool v3)
static inline bool tpacket_has_vlan_info(union tpacket_uhdr *hdr)
{
- uint32_t valid = 0;
+ uint32_t valid = TP_STATUS_VLAN_VALID;
#ifdef TP_STATUS_VLAN_TPID_VALID
- valid = TP_STATUS_VLAN_VALID;
+ valid |= TP_STATUS_VLAN_TPID_VALID;
#endif
- return tpacket_uhdr(*hdr, tp_status, true) &
- (TP_STATUS_VLAN_VALID | valid);
+ return tpacket_uhdr(*hdr, tp_status, true) & valid;
}
struct frame_map {