xfrm: add extack to xfrm_add_sa_expire
authorSabrina Dubroca <sd@queasysnail.net>
Thu, 24 Nov 2022 14:43:39 +0000 (15:43 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 25 Nov 2022 09:11:39 +0000 (10:11 +0100)
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c

index 25de6e8faf8d4eeddf440dfad57b938213b76013..1664baefae8003f77913290cc39e19d570bee5a3 100644 (file)
@@ -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) {