All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH 05/10] xfrm: add extack to xfrm_add_sa_expire
Date: Sat, 26 Nov 2022 12:02:58 +0100	[thread overview]
Message-ID: <20221126110303.1859238-6-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20221126110303.1859238-1-steffen.klassert@secunet.com>

From: Sabrina Dubroca <sd@queasysnail.net>

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_user.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 25de6e8faf8d..1664baefae80 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2584,8 +2584,11 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	spin_lock_bh(&x->lock);
 	err = -EINVAL;
-	if (x->km.state != XFRM_STATE_VALID)
+	if (x->km.state != XFRM_STATE_VALID) {
+		NL_SET_ERR_MSG(extack, "SA must be in VALID state");
 		goto out;
+	}
+
 	km_state_expired(x, ue->hard, nlh->nlmsg_pid);
 
 	if (ue->hard) {
-- 
2.25.1


  parent reply	other threads:[~2022-11-26 11:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 11:02 [PATCH 0/10] pull request (net-next): ipsec-next 2022-11-26 Steffen Klassert
2022-11-26 11:02 ` [PATCH 01/10] esp6: remove redundant variable err Steffen Klassert
2022-11-30  5:00   ` patchwork-bot+netdevbpf
2022-11-26 11:02 ` [PATCH 02/10] xfrm: update x->lastused for every packet Steffen Klassert
2022-11-26 11:02 ` [PATCH 03/10] xfrm: Remove not-used total variable Steffen Klassert
2022-11-26 11:02 ` [PATCH 04/10] xfrm: a few coding style clean ups Steffen Klassert
2022-11-26 11:02 ` Steffen Klassert [this message]
2022-11-26 11:02 ` [PATCH 06/10] xfrm: add extack to xfrm_del_sa Steffen Klassert
2022-11-26 11:03 ` [PATCH 07/10] xfrm: add extack to xfrm_new_ae and xfrm_replay_verify_len Steffen Klassert
2022-11-26 11:03 ` [PATCH 08/10] xfrm: add extack to xfrm_do_migrate Steffen Klassert
2022-11-26 11:03 ` [PATCH 09/10] xfrm: add extack to xfrm_alloc_userspi Steffen Klassert
2022-11-26 11:03 ` [PATCH 10/10] xfrm: add extack to xfrm_set_spdinfo Steffen Klassert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221126110303.1859238-6-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.