Commit 03dc7a35 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Steffen Klassert

ipv6: xfrm: use 64-bit timestamps

get_seconds() is deprecated because it can overflow on 32-bit
architectures.  For the xfrm_state->lastused member, we treat the data
as a 64-bit number already, so we just need to use the right accessor
that works on both 32-bit and 64-bit machines.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 386c5680
...@@ -227,7 +227,7 @@ struct xfrm_state { ...@@ -227,7 +227,7 @@ struct xfrm_state {
long saved_tmo; long saved_tmo;
/* Last used time */ /* Last used time */
unsigned long lastused; time64_t lastused;
struct page_frag xfrag; struct page_frag xfrag;
......
...@@ -55,7 +55,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb) ...@@ -55,7 +55,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
__skb_pull(skb, hdr_len); __skb_pull(skb, hdr_len);
memmove(ipv6_hdr(skb), iph, hdr_len); memmove(ipv6_hdr(skb), iph, hdr_len);
x->lastused = get_seconds(); x->lastused = ktime_get_real_seconds();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment