This change enforces the IP ID verification on outer headers. As a result if the DF flag is not set on the outer header we will force the flow to be flushed in the event that the IP ID is out of sequence with the existing flow.
Signed-off-by: Alexander Duyck <adu...@mirantis.com> --- net/ipv4/gre_offload.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index 540866dbd27d..7ea14ced9222 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c @@ -203,6 +203,20 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head, continue; } } + + /* Include the IP ID check from the outer IP hdr */ + if (!NAPI_GRO_CB(p)->flush_id) + continue; + + /* If flush_id is non-zero and rfc6864 is enabled for + * the new frame the only possibility is that we are + * incrementing so we can xor by count to cancel out + * the one acceptable value. + */ + NAPI_GRO_CB(p)->flush |= NAPI_GRO_CB(skb)->rfc6864 ? + NAPI_GRO_CB(p)->flush_id ^ + NAPI_GRO_CB(p)->count : + NAPI_GRO_CB(p)->flush_id; } skb_gro_pull(skb, grehlen);