mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
gro: Make GRO aware of lightweight tunnels.
GRO is currently not aware of tunnel metadata generated by lightweight
tunnels and stored in the dst. This leads to two possible problems:
* Incorrectly merging two frames that have different metadata.
* Leaking of allocated metadata from merged frames.
This avoids those problems by comparing the tunnel information before
merging, similar to how we handle other metadata (such as vlan tags),
and releasing any state when we are done.
Reported-by: John <john.phillips5@hpe.com>
Fixes: 2e15ea39
("ip_gre: Add support to collect tunnel metadata.")
Signed-off-by: Jesse Gross <jesse@kernel.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5f2f3cad8b
commit
ce87fc6ce3
2 changed files with 23 additions and 2 deletions
|
@ -4351,6 +4351,7 @@ static void gro_list_prepare(struct napi_struct *napi, struct sk_buff *skb)
|
|||
|
||||
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
|
||||
diffs |= p->vlan_tci ^ skb->vlan_tci;
|
||||
diffs |= skb_metadata_dst_cmp(p, skb);
|
||||
if (maclen == ETH_HLEN)
|
||||
diffs |= compare_ether_header(skb_mac_header(p),
|
||||
skb_mac_header(skb));
|
||||
|
@ -4548,10 +4549,12 @@ static gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
|
|||
break;
|
||||
|
||||
case GRO_MERGED_FREE:
|
||||
if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD)
|
||||
if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD) {
|
||||
skb_dst_drop(skb);
|
||||
kmem_cache_free(skbuff_head_cache, skb);
|
||||
else
|
||||
} else {
|
||||
__kfree_skb(skb);
|
||||
}
|
||||
break;
|
||||
|
||||
case GRO_HELD:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue