diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2018-11-10 19:58:34 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-16 19:25:28 -0800 |
commit | 5109f9fd6a76116090b34a192d4a957d2ad0621e (patch) | |
tree | a383afa11092adc24f6cf472aa44cb97b4b9547b | |
parent | 5aa25c05be0223aea170385484b0965c9fd90144 (diff) | |
download | linux-5109f9fd6a76116090b34a192d4a957d2ad0621e.tar.bz2 |
net/skbuff: add macros for VLAN_PRESENT bit
Wrap VLAN_PRESENT bit using macro like PKT_TYPE_* and CLONED_*,
as used by BPF code.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7dcfb5591dc3..99f38779332c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -816,6 +816,12 @@ struct sk_buff { __u32 priority; int skb_iif; __u32 hash; +#define PKT_VLAN_PRESENT_BIT 4 // CFI (12-th bit) in TCI +#ifdef __BIG_ENDIAN +#define PKT_VLAN_PRESENT_OFFSET() offsetof(struct sk_buff, vlan_tci) +#else +#define PKT_VLAN_PRESENT_OFFSET() (offsetof(struct sk_buff, vlan_tci) + 1) +#endif __be16 vlan_proto; __u16 vlan_tci; #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) |