[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200828052003.GD20687@gauss3.secunet.de>
Date: Fri, 28 Aug 2020 07:20:03 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Antony Antony <antony.antony@...unet.com>
CC: <netdev@...r.kernel.org>, Herbert Xu <herbert@...dor.apana.org.au>,
"Antony Antony" <antony@...nome.org>
Subject: Re: [PATCH v2 4/4] xfrm: clone whole liftime_cur structure in
xfrm_do_migrate
On Wed, Aug 26, 2020 at 09:40:40PM +0200, Antony Antony wrote:
> When we clone state only add_time was cloned. It missed values like
> bytes, packets. Now clone the all members of the structure.
>
> Fixes: 80c9abaabf42 ("[XFRM]: Extension for dynamic update of endpoint address(es)")
> Signed-off-by: Antony Antony <antony.antony@...unet.com>
> ---
> net/xfrm/xfrm_state.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index 16988303aed6..64eb4a6fcfc2 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -1550,7 +1550,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig,
> x->tfcpad = orig->tfcpad;
> x->replay_maxdiff = orig->replay_maxdiff;
> x->replay_maxage = orig->replay_maxage;
> - x->curlft.add_time = orig->curlft.add_time;
> + x->curlft = orig->curlft;
You should use memcpy if you want to copy the whole structure.
Powered by blists - more mailing lists