@@ -897,8 +897,6 @@ struct sk_buff {
__u32 priority;
int skb_iif;
__u32 hash;
- __be16 vlan_proto;
- __u16 vlan_tci;
#if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS)
union {
unsigned int napi_id;
@@ -955,6 +953,14 @@ struct sk_buff {
};
__u64 inner_headers;
};
+
+ union {
+ struct {
+ __be16 vlan_proto;
+ __u16 vlan_tci;
+ };
+ __u32 vlan_info;
+ };
};
#ifdef __KERNEL__
@@ -996,6 +996,8 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
__skb_ext_copy(new, old);
__nf_copy(new, old, false);
__skb_copy_inner_headers(new, old);
+ if (old->vlan_present)
+ new->vlan_info = old->vlan_info;
/* Note : this field could be in headers_start/headers_end section
* It is not yet because we do not want to have a 16 bit hole
@@ -1007,13 +1009,12 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
offsetof(struct sk_buff, headers_start));
CHECK_SKB_FIELD(_state);
CHECK_SKB_FIELD(__pkt_encapsulation_offset);
+ CHECK_SKB_FIELD(__pkt_vlan_present_offset);
CHECK_SKB_FIELD(protocol);
CHECK_SKB_FIELD(csum);
CHECK_SKB_FIELD(hash);
CHECK_SKB_FIELD(priority);
CHECK_SKB_FIELD(skb_iif);
- CHECK_SKB_FIELD(vlan_proto);
- CHECK_SKB_FIELD(vlan_tci);
CHECK_SKB_FIELD(transport_header);
CHECK_SKB_FIELD(network_header);
CHECK_SKB_FIELD(mac_header);
Such field validity is already tracked by the existing 'vlan_present' bit. Move them after tail and conditinally copy as needed. Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- include/linux/skbuff.h | 10 ++++++++-- net/core/skbuff.c | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-)