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 70a8c36..144238a 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 229544b..3585bfc 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);