diff options
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 2537f26f097c..1845b73d69f9 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1055,6 +1055,27 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu) | |||
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | EXPORT_SYMBOL(xfrm_state_mtu); | 1057 | EXPORT_SYMBOL(xfrm_state_mtu); |
1058 | |||
1059 | int xfrm_init_state(struct xfrm_state *x) | ||
1060 | { | ||
1061 | int err; | ||
1062 | |||
1063 | err = -ENOENT; | ||
1064 | x->type = xfrm_get_type(x->id.proto, x->props.family); | ||
1065 | if (x->type == NULL) | ||
1066 | goto error; | ||
1067 | |||
1068 | err = x->type->init_state(x); | ||
1069 | if (err) | ||
1070 | goto error; | ||
1071 | |||
1072 | x->km.state = XFRM_STATE_VALID; | ||
1073 | |||
1074 | error: | ||
1075 | return err; | ||
1076 | } | ||
1077 | |||
1078 | EXPORT_SYMBOL(xfrm_init_state); | ||
1058 | 1079 | ||
1059 | void __init xfrm_state_init(void) | 1080 | void __init xfrm_state_init(void) |
1060 | { | 1081 | { |