diff mbox series

[ipsec,1/3] Revert "xfrm: update SA curlft.use_time"

Message ID e66a68873492c0b3e02f8459e88cedabe255e3b6.1658936270.git.antony.antony@secunet.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [ipsec,1/3] Revert "xfrm: update SA curlft.use_time" | expand

Commit Message

Antony Antony July 27, 2022, 3:38 p.m. UTC
This reverts commit af734a26a1a95a9fda51f2abb0c22a7efcafd5ca.

The abvoce commit is a regression according RFC 2367. A better fix would be
use x->lastused. Which will be propsed later.

according to RFC 2367 use_time == sadb_lifetime_usetime.

"sadb_lifetime_usetime
                   For CURRENT, the time, in seconds, when association
                   was first used. For HARD and SOFT, the number of
                   seconds after the first use of the association until
                   it expires."

Fixes: af734a26a1a9 ("xfrm: update SA curlft.use_time")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
---
 net/xfrm/xfrm_input.c  | 1 -
 net/xfrm/xfrm_output.c | 1 -
 2 files changed, 2 deletions(-)

Comments

Steffen Klassert Aug. 4, 2022, 9:31 a.m. UTC | #1
On Wed, Jul 27, 2022 at 05:38:35PM +0200, Antony Antony wrote:
> This reverts commit af734a26a1a95a9fda51f2abb0c22a7efcafd5ca.
> 
> The abvoce commit is a regression according RFC 2367. A better fix would be
> use x->lastused. Which will be propsed later.
> 
> according to RFC 2367 use_time == sadb_lifetime_usetime.
> 
> "sadb_lifetime_usetime
>                    For CURRENT, the time, in seconds, when association
>                    was first used. For HARD and SOFT, the number of
>                    seconds after the first use of the association until
>                    it expires."
> 
> Fixes: af734a26a1a9 ("xfrm: update SA curlft.use_time")
> Signed-off-by: Antony Antony <antony.antony@secunet.com>

Series applied, thanks Antony!
diff mbox series

Patch

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 144238a50f3d..70a8c36f0ba6 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -669,7 +669,6 @@  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);
 
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 555ab35cd119..9a5e79a38c67 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -534,7 +534,6 @@  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);