diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2022-09-30 09:49:33 +0200 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2022-09-30 09:49:33 +0200 |
commit | c39596f6ad1bfe65fc2d926e0703cf26e3fae90a (patch) | |
tree | d64aaa95393dd8e3ea2b01ba438078af9e6b9635 /net/xfrm/xfrm_ipcomp.c | |
parent | 48ff45dade87eb24a4d7ca28fd813ca2e2ebe745 (diff) | |
parent | 28b5dbd5dcf7659f64713c66eb7301924e070bf8 (diff) |
Merge branch 'xfrm: add netlink extack to all the ->init_stat'
Sabrina Dubroca says:
============
This series completes extack support for state creation.
============
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_ipcomp.c')
-rw-r--r-- | net/xfrm/xfrm_ipcomp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index cb40ff0ff28d..656045a87606 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -325,18 +325,22 @@ void ipcomp_destroy(struct xfrm_state *x) } EXPORT_SYMBOL_GPL(ipcomp_destroy); -int ipcomp_init_state(struct xfrm_state *x) +int ipcomp_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) { int err; struct ipcomp_data *ipcd; struct xfrm_algo_desc *calg_desc; err = -EINVAL; - if (!x->calg) + if (!x->calg) { + NL_SET_ERR_MSG(extack, "Missing required compression algorithm"); goto out; + } - if (x->encap) + if (x->encap) { + NL_SET_ERR_MSG(extack, "IPComp is not compatible with encapsulation"); goto out; + } err = -ENOMEM; ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL); |