xfrm: update SA curlft.use_time
authorAntony Antony <antony.antony@secunet.com>
Fri, 17 Dec 2021 17:02:09 +0000 (18:02 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 23 Dec 2021 08:32:50 +0000 (09:32 +0100)
SA use_time was only updated once, for the first packet.
with this fix update the use_time for every packet.

Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c

index 70a8c36f0ba6e6acc8743a1e85bbf2c18842c0f2..144238a50f3d4e1efc99eb8e893650e60f1b3bda 100644 (file)
@@ -669,6 +669,7 @@ resume:
 
                x->curlft.bytes += skb->len;
                x->curlft.packets++;
+               x->curlft.use_time = ktime_get_real_seconds();
 
                spin_unlock(&x->lock);
 
index 229544bc70c21dec96b7d6f4465446dbe564cfa3..3585bfc302f97b1ae5f1ab9e07f99630dd579948 100644 (file)
@@ -533,6 +533,7 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
 
                x->curlft.bytes += skb->len;
                x->curlft.packets++;
+               x->curlft.use_time = ktime_get_real_seconds();
 
                spin_unlock_bh(&x->lock);