xfrm: pass extack down to xfrm_type ->init_state
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
Родитель
48ff45dade
Коммит
e1e10b44cf
|
@ -405,7 +405,8 @@ struct xfrm_type {
|
|||
#define XFRM_TYPE_LOCAL_COADDR 4
|
||||
#define XFRM_TYPE_REMOTE_COADDR 8
|
||||
|
||||
int (*init_state)(struct xfrm_state *x);
|
||||
int (*init_state)(struct xfrm_state *x,
|
||||
struct netlink_ext_ack *extack);
|
||||
void (*destructor)(struct xfrm_state *);
|
||||
int (*input)(struct xfrm_state *, struct sk_buff *skb);
|
||||
int (*output)(struct xfrm_state *, struct sk_buff *pskb);
|
||||
|
|
|
@ -471,7 +471,7 @@ static int ah4_err(struct sk_buff *skb, u32 info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ah_init_state(struct xfrm_state *x)
|
||||
static int ah_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct ah_data *ahp = NULL;
|
||||
struct xfrm_algo_desc *aalg_desc;
|
||||
|
|
|
@ -1131,7 +1131,7 @@ error:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int esp_init_state(struct xfrm_state *x)
|
||||
static int esp_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct crypto_aead *aead;
|
||||
u32 align;
|
||||
|
|
|
@ -117,7 +117,8 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ipcomp4_init_state(struct xfrm_state *x)
|
||||
static int ipcomp4_init_state(struct xfrm_state *x,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
|
|||
return ip_hdr(skb)->protocol;
|
||||
}
|
||||
|
||||
static int ipip_init_state(struct xfrm_state *x)
|
||||
static int ipip_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (x->props.mode != XFRM_MODE_TUNNEL)
|
||||
return -EINVAL;
|
||||
|
|
|
@ -666,7 +666,7 @@ static int ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ah6_init_state(struct xfrm_state *x)
|
||||
static int ah6_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct ah_data *ahp = NULL;
|
||||
struct xfrm_algo_desc *aalg_desc;
|
||||
|
|
|
@ -1174,7 +1174,7 @@ error:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int esp6_init_state(struct xfrm_state *x)
|
||||
static int esp6_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct crypto_aead *aead;
|
||||
u32 align;
|
||||
|
|
|
@ -136,7 +136,8 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ipcomp6_init_state(struct xfrm_state *x)
|
||||
static int ipcomp6_init_state(struct xfrm_state *x,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
|
|||
return err;
|
||||
}
|
||||
|
||||
static int mip6_destopt_init_state(struct xfrm_state *x)
|
||||
static int mip6_destopt_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (x->id.spi) {
|
||||
pr_info("%s: spi is not 0: %u\n", __func__, x->id.spi);
|
||||
|
@ -333,7 +333,7 @@ static int mip6_rthdr_output(struct xfrm_state *x, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int mip6_rthdr_init_state(struct xfrm_state *x)
|
||||
static int mip6_rthdr_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (x->id.spi) {
|
||||
pr_info("%s: spi is not 0: %u\n", __func__, x->id.spi);
|
||||
|
|
|
@ -270,7 +270,7 @@ static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int xfrm6_tunnel_init_state(struct xfrm_state *x)
|
||||
static int xfrm6_tunnel_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
|
||||
{
|
||||
if (x->props.mode != XFRM_MODE_TUNNEL)
|
||||
return -EINVAL;
|
||||
|
|
|
@ -2673,7 +2673,7 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload,
|
|||
|
||||
x->type_offload = xfrm_get_type_offload(x->id.proto, family, offload);
|
||||
|
||||
err = x->type->init_state(x);
|
||||
err = x->type->init_state(x, extack);
|
||||
if (err)
|
||||
goto error;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче