Skip to content

Commit

Permalink
xfrm: update SA curlft.use_time
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antony Antony authored and Steffen Klassert committed Dec 23, 2021
1 parent ac1077e commit af734a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/xfrm/xfrm_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)

x->curlft.bytes += skb->len;
x->curlft.packets++;
x->curlft.use_time = ktime_get_real_seconds();

spin_unlock(&x->lock);

Expand Down
1 change: 1 addition & 0 deletions net/xfrm/xfrm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit af734a2

Please sign in to comment.